From 7f9fa5730b61064d26e723ff132a18ea79ce4f35 Mon Sep 17 00:00:00 2001 From: Abiola Ibrahim Date: Sun, 20 Sep 2015 18:13:53 +0100 Subject: [PATCH] Rewrite: Use only `fragment`, remove `frag`. --- middleware/replacer.go | 1 - middleware/rewrite/rewrite_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/middleware/replacer.go b/middleware/replacer.go index 9d34253c..29c695b7 100644 --- a/middleware/replacer.go +++ b/middleware/replacer.go @@ -41,7 +41,6 @@ func NewReplacer(r *http.Request, rr *responseRecorder, emptyValue string) Repla "{host}": r.Host, "{path}": r.URL.Path, "{query}": r.URL.RawQuery, - "{frag}": r.URL.Fragment, "{fragment}": r.URL.Fragment, "{proto}": r.Proto, "{remote}": func() string { diff --git a/middleware/rewrite/rewrite_test.go b/middleware/rewrite/rewrite_test.go index d9056b43..b4845f10 100644 --- a/middleware/rewrite/rewrite_test.go +++ b/middleware/rewrite/rewrite_test.go @@ -28,7 +28,7 @@ func TestRewrite(t *testing.T) { []string{"/ab/", "ab", "/ab?type=html&{query}", ".html|"}, []string{"/abc/", "ab", "/abc/{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", ""}, }