File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
common/etc/nginx/templates Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ server {
3030 # information that could be used to find an exploit.
3131 server_tokens off;
3232
33+ # Normalize location path. Remove instances of double/multipe forward slashes.
34+ # Disabling merge_slashes is necessary for this feature to work.
35+ # Disabling port redirection to avoid broken URLs in bridged hosts
36+ port_in_redirect off;
37+ merge_slashes off;
38+ rewrite (.*?)//+(.*) $1/$2 redirect;
39+
3340 # Uncomment this for a HTTP header that will let you know the cache status
3441 # of an object.
3542 # add_header X-Cache-Status $upstream_cache_status;
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ assertHttpRequestEquals "HEAD" "a.txt?some=param&that=should&be=stripped#aaah" "
153153assertHttpRequestEquals " HEAD" " b/c/d.txt" " 200"
154154assertHttpRequestEquals " HEAD" " b/c/../e.txt" " 200"
155155assertHttpRequestEquals " HEAD" " b/e.txt" " 200"
156- assertHttpRequestEquals " HEAD" " b//e.txt" " 200 "
156+ assertHttpRequestEquals " HEAD" " b//e.txt" " 302 "
157157assertHttpRequestEquals " HEAD" " a/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.txt" " 200"
158158
159159# We try to request URLs that are properly encoded as well as URLs that
220220assertHttpRequestEquals " HEAD" " b/" " 404"
221221assertHttpRequestEquals " HEAD" " /b/c/" " 404"
222222assertHttpRequestEquals " HEAD" " /soap" " 404"
223- if [ " ${append_slash} " == " 1" ] && [ " ${index_page} " == " 0" ]; then
224223assertHttpRequestEquals " HEAD" " b//c" " 302"
225- else
226- assertHttpRequestEquals " HEAD" " b//c" " 404"
227- fi
228224
229225if [ " ${index_page} " == " 1" ]; then
230226assertHttpRequestEquals " HEAD" " /statichost/" " 200"
You can’t perform that action at this time.
0 commit comments