Replace url-unsafe characters in base64 query data

This commit is contained in:
Dan Sosedoff
2016-02-18 21:17:31 -06:00
parent 586605557e
commit 540613645f
5 changed files with 45 additions and 8 deletions

19
pkg/api/helpers_test.go Normal file
View 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))
}
}