aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-08 22:27:22 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-08 22:27:22 -0800
commitcb41d77d2aa9ae3b4d938167d86679a429bee4fe (patch)
tree6b57e6bd45c29ec7712372451304eb3b9d548bee /src
parent0fd7d3a8c3957f2bd4488841271750146f7a674b (diff)
downloadbun-cb41d77d2aa9ae3b4d938167d86679a429bee4fe.tar.gz
bun-cb41d77d2aa9ae3b4d938167d86679a429bee4fe.tar.zst
bun-cb41d77d2aa9ae3b4d938167d86679a429bee4fe.zip
Fixes #1426
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/webcore/response.zig5
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;