Skip to content

Commit

Permalink
🚀 Added possibility to work with urlencoded special characters in the…
Browse files Browse the repository at this point in the history
… route
  • Loading branch information
ReneWerner87 committed Jun 25, 2020
1 parent eb0b365 commit 0a4f58f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,17 @@ func Benchmark_Utils_getGroupPath(b *testing.B) {
// func Benchmark_Utils_parseTokenList(b *testing.B) {
// // TODO
// }

func Benchmark_Utils_Unescape(b *testing.B) {
unescaped := ""
dst := make([]byte, 0)

for n := 0; n < b.N; n++ {
source := "/cr%C3%A9er"
pathBytes := getBytes(source)
pathBytes = fasthttp.AppendUnquotedArg(dst[:0], pathBytes)
unescaped = getString(pathBytes)
}

utils.AssertEqual(b, "/créer", unescaped)
}

0 comments on commit 0a4f58f

Please sign in to comment.