0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

Rewrite: Use only fragment, remove frag.

This commit is contained in:
Abiola Ibrahim 2015-09-20 18:13:53 +01:00
parent 0e039a1868
commit 7f9fa5730b
2 changed files with 1 additions and 2 deletions

View file

@ -41,7 +41,6 @@ func NewReplacer(r *http.Request, rr *responseRecorder, emptyValue string) Repla
"{host}": r.Host, "{host}": r.Host,
"{path}": r.URL.Path, "{path}": r.URL.Path,
"{query}": r.URL.RawQuery, "{query}": r.URL.RawQuery,
"{frag}": r.URL.Fragment,
"{fragment}": r.URL.Fragment, "{fragment}": r.URL.Fragment,
"{proto}": r.Proto, "{proto}": r.Proto,
"{remote}": func() string { "{remote}": func() string {

View file

@ -28,7 +28,7 @@ func TestRewrite(t *testing.T) {
[]string{"/ab/", "ab", "/ab?type=html&{query}", ".html|"}, []string{"/ab/", "ab", "/ab?type=html&{query}", ".html|"},
[]string{"/abc/", "ab", "/abc/{file}", ".html|"}, []string{"/abc/", "ab", "/abc/{file}", ".html|"},
[]string{"/abcd/", "ab", "/a/{dir}/{file}", ".html|"}, []string{"/abcd/", "ab", "/a/{dir}/{file}", ".html|"},
[]string{"/abcde/", "ab", "/a#{frag}", ".html|"}, []string{"/abcde/", "ab", "/a#{fragment}", ".html|"},
[]string{"/ab/", `.*\.jpg`, "/ajpg", ""}, []string{"/ab/", `.*\.jpg`, "/ajpg", ""},
} }