mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
fix: use the non-query path for routing
This commit is contained in:
parent
bdd2fd8160
commit
f8a5968984
1 changed files with 3 additions and 1 deletions
|
|
@ -351,6 +351,8 @@ module Request = struct
|
|||
let path self = self.path
|
||||
let body self = self.body
|
||||
|
||||
let non_query_path self = Tiny_httpd_util.get_non_query_path self.path
|
||||
|
||||
let query self =
|
||||
match Tiny_httpd_util.(parse_query @@ get_query self.path) with
|
||||
| Ok l -> l
|
||||
|
|
@ -663,7 +665,7 @@ let add_path_handler_
|
|||
match meth with
|
||||
| Some m when m <> req.Request.meth -> None (* ignore *)
|
||||
| _ ->
|
||||
begin match Scanf.sscanf req.Request.path fmt f with
|
||||
begin match Scanf.sscanf (Request.non_query_path req) fmt f with
|
||||
| handler ->
|
||||
(* we have a handler, do we accept the request based on its headers? *)
|
||||
begin match accept req with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue