You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Path variables in a URI template can specify a regex to limit the matches. However, since http4k applies the regex to the raw, "unnormalized" URI, the regex needs to deal with all possible identical URIs encodings: /test/abc, /test/%61bc, etc., which is unrealistic. I think http4k should normalize the URI first before passing it to the UriTemplate.
Reproducer:
val routes = routes(
"/test/{param:[a-zA-Z0-9]+}" bind GET to {
Response(Status.OK)
}
)
routes(Request(GET, "/test/abc")).status // 200 OK
routes(Request(GET, "/test/%61bc")).status // 404 Route not found
The text was updated successfully, but these errors were encountered:
It is a bit complicated. You cannot treat the URI path as a single element and normalize it. You have consider each path part independently. For example: /article/doi/10.1002%2F0470841559.ch1 - is not the same as /article/doi/10.1002/0470841559.ch1
Path variables in a URI template can specify a regex to limit the matches. However, since http4k applies the regex to the raw, "unnormalized" URI, the regex needs to deal with all possible identical URIs encodings:
/test/abc
,/test/%61bc
, etc., which is unrealistic. I think http4k should normalize the URI first before passing it to theUriTemplate
.Reproducer:
The text was updated successfully, but these errors were encountered: