diff options
author | 2022-03-01 22:19:15 -0800 | |
---|---|---|
committer | 2022-03-01 22:19:15 -0800 | |
commit | 78cae049d2c8f7fa4f7cde8ed5b8895b3e32b5fc (patch) | |
tree | 0998a2e0787b4e5dac8c0ecb0a333d91232863d5 /src/http.zig | |
parent | 7b4f239d33f2c9641350ce32cede2141e3075c72 (diff) | |
download | bun-78cae049d2c8f7fa4f7cde8ed5b8895b3e32b5fc.tar.gz bun-78cae049d2c8f7fa4f7cde8ed5b8895b3e32b5fc.tar.zst bun-78cae049d2c8f7fa4f7cde8ed5b8895b3e32b5fc.zip |
cleanup code that checks if it should send an HTTP body
Diffstat (limited to 'src/http.zig')
-rw-r--r-- | src/http.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/http.zig b/src/http.zig index 634d9f1f4..fa0e806ea 100644 --- a/src/http.zig +++ b/src/http.zig @@ -2092,7 +2092,7 @@ pub const RequestContext = struct { ctx.appendHeader("Content-Type", "text/plain"); } - const send_body = ctx.method == .GET; + const send_body = ctx.method.hasBody(); switch (result.file.value) { .pending => |resolve_result| { @@ -2570,7 +2570,7 @@ pub const RequestContext = struct { if (buffer.len == 0) { return try ctx.sendNoContent(); } - const send_body = ctx.method == .GET; + const send_body = ctx.method.hasBody(); defer ctx.done(); try ctx.writeStatus(200); try ctx.prepareToSendBody(buffer.len, false); @@ -2593,7 +2593,7 @@ pub const RequestContext = struct { if (buffer.len == 0) { return try ctx.sendNoContent(); } - const send_body = ctx.method == .GET; + const send_body = ctx.method.hasBody(); defer ctx.done(); try ctx.writeStatus(200); try ctx.prepareToSendBody(buffer.len, false); @@ -2630,7 +2630,7 @@ pub const RequestContext = struct { if (buffer.len == 0) { return try ctx.sendNoContent(); } - const send_body = ctx.method == .GET; + const send_body = ctx.method.hasBody(); defer ctx.done(); try ctx.writeStatus(200); try ctx.prepareToSendBody(buffer.len, false); @@ -2656,7 +2656,7 @@ pub const RequestContext = struct { if (buffer.len == 0) { return try ctx.sendNoContent(); } - const send_body = ctx.method == .GET; + const send_body = ctx.method.hasBody(); defer ctx.done(); try ctx.writeStatus(200); try ctx.prepareToSendBody(buffer.len, false); @@ -2708,7 +2708,7 @@ pub const RequestContext = struct { if (buffer.len == 0) { return try ctx.sendNoContent(); } - const send_body = ctx.method == .GET; + const send_body = ctx.method.hasBody(); defer ctx.done(); try ctx.writeStatus(200); try ctx.prepareToSendBody(buffer.len, false); |