diff options
author | 2022-02-04 00:57:12 -0800 | |
---|---|---|
committer | 2022-02-04 00:57:12 -0800 | |
commit | a89726b30ce79210daeecc0a008d74dd772bace1 (patch) | |
tree | c5f6df5b94b87b0601f4dc5cbd9d8b90861c0292 | |
parent | 3225a4e7e8937152893432f8f157a006a42f856c (diff) | |
download | bun-a89726b30ce79210daeecc0a008d74dd772bace1.tar.gz bun-a89726b30ce79210daeecc0a008d74dd772bace1.tar.zst bun-a89726b30ce79210daeecc0a008d74dd772bace1.zip |
[bun dev] Fix bug with serving static files on next.js apps introduced in af69b47c228783825e1bae9873dda878cf5bdebf
-rw-r--r-- | src/http.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/http.zig b/src/http.zig index 071364454..03ebf50d3 100644 --- a/src/http.zig +++ b/src/http.zig @@ -3313,7 +3313,7 @@ pub const Server = struct { // Note: the public folder may actually just be the root folder // In this case, we only check if the pathname has no extension if (!finished) { - if (req_ctx.matchPublicFolder(true)) |result| { + if (req_ctx.matchPublicFolder(comptime features.public_folder != .first)) |result| { finished = true; req_ctx.renderServeResult(result) catch |err| { Output.printErrorln("FAIL [{s}] - {s}: {s}", .{ @errorName(err), req.method, req.path }); @@ -3341,7 +3341,7 @@ pub const Server = struct { }, } }; - finished = true; + finished = req_ctx.controlled or req_ctx.has_called_done; } } else { request_handler: { @@ -3357,7 +3357,7 @@ pub const Server = struct { }, } }; - finished = true; + finished = finished or req_ctx.has_called_done; } } } @@ -3384,7 +3384,7 @@ pub const Server = struct { did_print = true; }; } - finished = true; + finished = finished or req_ctx.has_called_done; } } @@ -3517,7 +3517,9 @@ pub const Server = struct { } } else if (server.bundler.router != null) { try server.run( - ConnectionFeatures{ .filesystem_router = true }, + ConnectionFeatures{ + .filesystem_router = true, + }, ); } else if (server.bundler.options.routes.static_dir_enabled) { if (!public_folder_is_top_level) { |