4 ms·
I've had the same issues when developing with Flask in Python. I forgot to URL encode some query parameters and it worked fine with the local HTTP server. But
by rcconf 12y ago
I've had the same issues when developing with Flask in Python. I forgot to URL encode some query parameters and it worked fine with the local HTTP server.
But when I put nginx in front as a proxy, it denied all requests.
- stevekemp 12y agoThe thttpd webserver doesn't handle requests with too many slashes either, which I only found out recently This is treated as an invalid request: http://example.com//robots.txt
- zimpenfish 12y agoUnless I'm reading RFC 3986 incorrectly, that's valid because you can't have an empty segment in the path part of a URI.
- ajanuary 12y agoI think you're reading it incorrectly. You can have an empty segment in the path. The BNF for a segment is: segment = *pchar Which according to RFC2234 section 3.6 means zero or more repetitions.
- gpvos 12y agoBut then the server may still decide that an empty segment is so meaningless that it will refuse it. In fact, it would not be a smart move to just treat double slashes the same as single ones, because of relative URLs: a ".." segment only removes one slash, so the hierarchy levels would get messed up. thttpd is doing the smart thing here. As one of my teachers at university would say: the empty segment is also a segment.
- lmm 12y agoThe server can of course interpret the path as it wants, but it should allow an application running under the server to give 'foo//bar' a meaning if that application wants to, IMO.
- ajanuary 12y agoYes, it's a valid URI but //robots.txt is different resource to /robots.txt. It seems thttpd is probay doing the right thing.
- zimpenfish 12y agoThe difference between `path-abempty` and `path-absolute` is bloody confusing but I think you're right.