tarantool / http

Tarantool http server
Other
80 stars 39 forks source link

Failed to parse request: invalid uri #171

Closed eugenepaniot closed 1 year ago

eugenepaniot commented 2 years ago

https://github.com/tarantool/http/blob/606fa09bf4e8e4bd911e4d78a9d3fd3ee5042cdb/http/server.lua#L738

Tarantool suggests the url request /some/valid/path./ as invalid, but it should not.

httpd:route({ path = '/some/valid/*path', method = 'GET', public = true }, http_middleware.v1(handle_get_path, http_collector) )

I need to get request path as is. Thank you.

How to reproduce:

$ curl -v 'http://127.1:8081/some/valid/path./'

*   Trying 127.0.0.1:8081...
* Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)
> GET /some/valid/path./ HTTP/1.1
> Host: 127.0.0.1:8081
> User-Agent: curl/7.84.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 400 Bad request
<
* Closing connection 0
invalid uri
Totktonada commented 2 years ago

NB: It comes from ff01a9400f30633d135f22f48e2e110923d6fe26.

Totktonada commented 2 years ago

So it was implemented for the http client (now an http client is built into tarantool itself). And it is anyway a strange thing. It is valid URI with relative path. I don't see a proper reason to ban it.

0x501D commented 2 years ago

Does the http client handle "./" and "../" as per rfc3986 clause 5.2.4. "Remove Dot Segments"?