diff --git a/url/url.go b/url/url.go index 6614ecf..bbc7784 100644 --- a/url/url.go +++ b/url/url.go @@ -238,10 +238,7 @@ func decodeUnicodeEscapes(inputURL string) string { // Parse and return URL func ParseURL(inputURL string, unsafe bool) (*URL, error) { - if unsafe { - inputURL = decodeUnicodeEscapes(inputURL) - } - + inputURL = decodeUnicodeEscapes(inputURL) u := &URL{ URL: &url.URL{}, Original: inputURL, diff --git a/url/url_test.go b/url/url_test.go index 79c9446..e128bf3 100644 --- a/url/url_test.go +++ b/url/url_test.go @@ -118,7 +118,7 @@ func TestParseRelativePath(t *testing.T) { } } -func TestUnicodeEscapeWithUnsafe(t *testing.T) { +func TestUnicodeEscape(t *testing.T) { testcases := []struct { input string expected string @@ -127,7 +127,7 @@ func TestUnicodeEscapeWithUnsafe(t *testing.T) { } for _, v := range testcases { - urlx, err := ParseURL(v.input, true) + urlx, err := Parse(v.input) require.Nilf(t, err, "got error for url %v", v.input) require.Equal(t, v.expected, urlx.String()) }