admin管理员组

文章数量:1394182

I cannot find it anywhere, nor in the source code of Apache nor on any page references for this happening, but somehow Apache normalizes URIs

from

 /with/space

into


as seem from a django application routed via wsgi.

When using gunicorn (also wsgi) or django's runserver, this normalization does not happen and the code returns 404. With Apache, the space before a slash is removed. I verified via a middleware which shows different results on Apache and Gunicorn/Runserver.

Apache does not normalize spaces anywhere else but right before a slash. Every other space is kept as is.

The RFC 3968 does not say anything about this under the normalization topic (ref).

The Apache source code for ap_normalize_path does not have anything regarding space before slash normalization. It only seems to normalize multiple slashes and dots.

It might be possible mod_wsgi is the culprit here, but I also did not find anything relevant.

本文标签: mod wsgiApache removing spaces before slashes in the PATH of an URIStack Overflow