Replace url-unsafe characters in base64 query data
This commit is contained in:
19
pkg/api/helpers_test.go
Normal file
19
pkg/api/helpers_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_desanitize64(t *testing.T) {
|
||||
examples := map[string]string{
|
||||
"test": "test",
|
||||
"test+test+": "test-test-",
|
||||
"test/test/": "test_test_",
|
||||
"test=test==": "test.test..",
|
||||
}
|
||||
|
||||
for expected, example := range examples {
|
||||
assert.Equal(t, expected, desanitize64(example))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user