aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api/server.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-09 15:11:14 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-09 15:11:14 -0800
commitda257336b0b70df8c31da647496899cf70670000 (patch)
tree6baca9ead683633e8feac503529d94e8a565445c /src/bun.js/api/server.zig
parent565996a087df6d06b2b5109b6825c720d4c8b168 (diff)
downloadbun-da257336b0b70df8c31da647496899cf70670000.tar.gz
bun-da257336b0b70df8c31da647496899cf70670000.tar.zst
bun-da257336b0b70df8c31da647496899cf70670000.zip
Fix #1354
Diffstat (limited to 'src/bun.js/api/server.zig')
-rw-r--r--src/bun.js/api/server.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 8a9ae8c54..c95949aa2 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -4079,6 +4079,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
.vm = JSC.VirtualMachine.vm,
.allocator = Arena.getThreadlocalDefault(),
};
+
if (RequestContext.pool == null) {
RequestContext.pool = server.allocator.create(RequestContext.RequestContextStackAllocator) catch @panic("Out of memory!");
RequestContext.pool.?.* = .{
@@ -4256,11 +4257,12 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
var ctx = this.request_pool_allocator.create(RequestContext) catch @panic("ran out of memory");
ctx.create(this, req, resp);
var request_object = this.allocator.create(JSC.WebCore.Request) catch unreachable;
+
request_object.* = .{
.url = "",
.method = ctx.method,
.uws_request = req,
- .base_url_string_for_joining = this.base_url_string_for_joining,
+ .https = ssl_enabled,
.body = .{
.Empty = .{},
},
@@ -4339,8 +4341,8 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
.url = "",
.method = ctx.method,
.uws_request = req,
- .base_url_string_for_joining = this.base_url_string_for_joining,
.upgrader = ctx,
+ .https = ssl_enabled,
.body = .{
.Empty = .{},
},