diff options
author | 2022-11-08 22:27:22 -0800 | |
---|---|---|
committer | 2022-11-08 22:27:22 -0800 | |
commit | cb41d77d2aa9ae3b4d938167d86679a429bee4fe (patch) | |
tree | 6b57e6bd45c29ec7712372451304eb3b9d548bee /src/bun.js | |
parent | 0fd7d3a8c3957f2bd4488841271750146f7a674b (diff) | |
download | bun-cb41d77d2aa9ae3b4d938167d86679a429bee4fe.tar.gz bun-cb41d77d2aa9ae3b4d938167d86679a429bee4fe.tar.zst bun-cb41d77d2aa9ae3b4d938167d86679a429bee4fe.zip |
Fixes #1426
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/webcore/response.zig | 5 |
1 files changed, 4 insertions, 1 deletions
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("<r><b>{s}<r>", 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; |