From cb41d77d2aa9ae3b4d938167d86679a429bee4fe Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Tue, 8 Nov 2022 22:27:22 -0800 Subject: Fixes #1426 --- src/bun.js/webcore/response.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig index ee62d518b..0bb776d6c 100644 --- a/src/bun.js/webcore/response.zig +++ b/src/bun.js/webcore/response.zig @@ -5187,7 +5187,7 @@ pub const Request = struct { }; } - pub fn writeFormat(this: *const Request, formatter: *JSC.Formatter, writer: anytype, comptime enable_ansi_colors: bool) !void { + pub fn writeFormat(this: *Request, formatter: *JSC.Formatter, writer: anytype, comptime enable_ansi_colors: bool) !void { const Writer = @TypeOf(writer); try formatter.writeIndent(Writer, writer); try writer.print("Request ({}) {{\n", .{bun.fmt.size(this.body.slice().len)}); @@ -5204,7 +5204,9 @@ pub const Request = struct { try formatter.writeIndent(Writer, writer); try writer.writeAll("url: \""); + try this.ensureURL(); try writer.print(comptime Output.prettyFmt("{s}", enable_ansi_colors), .{this.url}); + try writer.writeAll("\""); if (this.body == .Blob) { try writer.writeAll("\n"); @@ -5376,6 +5378,7 @@ pub const Request = struct { return 0; } + pub fn ensureURL(this: *Request) !void { if (this.url.len > 0) return; -- cgit v1.2.3