Skip to content

Commit

Permalink
Revert "allow w/ unsafe"
Browse files Browse the repository at this point in the history
This reverts commit b075bdf.
  • Loading branch information
dogancanbakir committed Aug 25, 2023
1 parent b075bdf commit fd891a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions url/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions url/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
}
Expand Down

0 comments on commit fd891a5

Please sign in to comment.