From 4f41c3fb40a7cd23a48c1a888353059a69693fa8 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Tue, 22 Nov 2022 21:25:26 -0800 Subject: [FileSystemRouter] Fix failing tests --- src/bun.js/api/filesystem_router.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/bun.js/api/filesystem_router.zig') diff --git a/src/bun.js/api/filesystem_router.zig b/src/bun.js/api/filesystem_router.zig index 96c094b5c..f43a30d4e 100644 --- a/src/bun.js/api/filesystem_router.zig +++ b/src/bun.js/api/filesystem_router.zig @@ -290,6 +290,7 @@ pub const FileSystemRouter = struct { .arena = arena, .allocator = allocator, }; + router.config.dir = fs_router.base_dir.?.slice(); fs_router.base_dir.?.ref(); return fs_router; } @@ -701,8 +702,10 @@ pub const MatchedRoute = struct { this: *MatchedRoute, globalThis: *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue { - if (this.route.query_string.len == 0) { + if (this.route.query_string.len == 0 and this.route.params.len == 0) { return JSValue.createEmptyObject(globalThis, 0); + } else if (this.route.query_string.len == 0) { + return this.getParams(globalThis); } if (this.query_string_map == null) { -- cgit v1.2.3