diff options
| author | 2021-08-07 18:57:41 -0700 | |
|---|---|---|
| committer | 2021-08-07 18:57:41 -0700 | |
| commit | de35ad995eb76b281045d7f7a626c4e05afdc408 (patch) | |
| tree | 6f25dad9e55294529af3a070d26bae0133b14f1a /src/javascript/jsc | |
| parent | 8ce74beafa7712bfc3d967944c55307f08a376de (diff) | |
| download | bun-de35ad995eb76b281045d7f7a626c4e05afdc408.tar.gz bun-de35ad995eb76b281045d7f7a626c4e05afdc408.tar.zst bun-de35ad995eb76b281045d7f7a626c4e05afdc408.zip | |
SSR!
Former-commit-id: bbc23b382c2eec15436fad632f5efe06e8e8360d
Diffstat (limited to 'src/javascript/jsc')
| -rw-r--r-- | src/javascript/jsc/api/router.zig | 19 | ||||
| -rw-r--r-- | src/javascript/jsc/javascript.zig | 3 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/javascript/jsc/api/router.zig b/src/javascript/jsc/api/router.zig index f1c892d94..14deaea66 100644 --- a/src/javascript/jsc/api/router.zig +++ b/src/javascript/jsc/api/router.zig @@ -5,6 +5,7 @@ const FilesystemRouter = @import("../../../router.zig"); const http = @import("../../../http.zig"); const JavaScript = @import("../javascript.zig"); const QueryStringMap = @import("../../../query_string_map.zig").QueryStringMap; +const CombinedScanner = @import("../../../query_string_map.zig").CombinedScanner; usingnamespace @import("../bindings/bindings.zig"); usingnamespace @import("../webcore/response.zig"); const Router = @This(); @@ -327,9 +328,21 @@ pub fn getQuery( exception: js.ExceptionRef, ) js.JSValueRef { if (this.query_string_map == null) { - if (QueryStringMap.init(getAllocator(ctx), this.route.query_string)) |map| { - this.query_string_map = map; - } else |err| {} + if (this.route.params.len > 0) { + if (QueryStringMap.initWithScanner(getAllocator(ctx), CombinedScanner.init( + this.route.query_string, + this.route.pathnameWithoutLeadingSlash(), + this.route.name, + + this.route.params, + ))) |map| { + this.query_string_map = map; + } else |err| {} + } else { + if (QueryStringMap.init(getAllocator(ctx), this.route.query_string)) |map| { + this.query_string_map = map; + } else |err| {} + } } // If it's still null, the query string has no names. diff --git a/src/javascript/jsc/javascript.zig b/src/javascript/jsc/javascript.zig index 1de47d46e..dccfdcf00 100644 --- a/src/javascript/jsc/javascript.zig +++ b/src/javascript/jsc/javascript.zig @@ -126,9 +126,6 @@ pub const VirtualMachine = struct { vm.console, ); VirtualMachine.vm_loaded = true; - std.debug.print("VM IS LOADED {}", .{ - VirtualMachine.vm_loaded, - }); return VirtualMachine.vm; } |
