Changes with Apache 2.0.40
+ *) Accept multiple leading /'s for requests within the DocumentRoot.
+ PR 10946 [William Rowe]
+
*) Solved the reports of .pdf byterange failures on Win32 alone.
APR's sendfile for the win32 platform collapses header and trailer
buffers into a single buffer. However, we destroyed the pointers
&& !strncmp(r->uri, r->server->path, r->server->pathlen)
&& (r->server->path[r->server->pathlen - 1] == '/'
|| r->uri[r->server->pathlen] == '/'
- || r->uri[r->server->pathlen] == '\0')) {
- if (apr_filepath_merge(&r->filename, conf->ap_document_root,
- r->uri + r->server->pathlen,
+ || r->uri[r->server->pathlen] == '\0'))
+ {
+ /* skip all leading /'s (e.g. http://localhost///foo)
+ * so we are looking at only the relative path.
+ */
+ char *path = r->uri + r->server->pathlen;
+ while (*path == '/') {
+ ++*path;
+ }
+ if (apr_filepath_merge(&r->filename, conf->ap_document_root, path,
APR_FILEPATH_TRUENAME
| APR_FILEPATH_SECUREROOT, r->pool)
!= APR_SUCCESS) {
* /'s in a row. This happens under windows when the document
* root ends with a /
*/
- if (apr_filepath_merge(&r->filename, conf->ap_document_root,
- r->uri + ((*(r->uri) == '/') ? 1 : 0),
+ /* skip all leading /'s (e.g. http://localhost///foo)
+ * so we are looking at only the relative path.
+ */
+ char *path = r->uri;
+ while (*path == '/') {
+ ++*path;
+ }
+ if (apr_filepath_merge(&r->filename, conf->ap_document_root, path,
APR_FILEPATH_TRUENAME
| APR_FILEPATH_SECUREROOT, r->pool)
!= APR_SUCCESS) {