aboutsummaryrefslogtreecommitdiff
path: root/uri_test.go
diff options
context:
space:
mode:
authorGravatar Daniel Firsht <dfirsht@gmail.com> 2019-09-17 23:56:18 -0700
committerGravatar Erik Dubbelboer <erik@dubbelboer.com> 2019-09-18 08:56:18 +0200
commitee8450036eb75d30d45d58a7c8aeff41b881d7cc (patch)
treea072c2b455731613b97ff8b44df1acd23d96d094 /uri_test.go
parentUpdate fuzzit (diff)
downloadfasthttp-ee8450036eb75d30d45d58a7c8aeff41b881d7cc.tar.gz
fasthttp-ee8450036eb75d30d45d58a7c8aeff41b881d7cc.tar.bz2
fasthttp-ee8450036eb75d30d45d58a7c8aeff41b881d7cc.zip
Added option to disable path normalization (#649)
Diffstat (limited to 'uri_test.go')
-rw-r--r--uri_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/uri_test.go b/uri_test.go
index 7ed05f9..84f9380 100644
--- a/uri_test.go
+++ b/uri_test.go
@@ -184,6 +184,16 @@ func testURIPathNormalize(t *testing.T, u *URI, requestURI, expectedPath string)
}
}
+func TestURINoNormalization(t *testing.T) {
+ var u URI
+ irregularPath := "/aaa%2Fbbb%2F%2E.%2Fxxx"
+ u.Parse(nil, []byte(irregularPath))
+ u.DisablePathNormalizing = true
+ if string(u.RequestURI()) != irregularPath {
+ t.Fatalf("Unexpected path %q. Expected %q.", u.Path(), irregularPath)
+ }
+}
+
func TestURICopyTo(t *testing.T) {
var u URI
var copyU URI