mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
- according to discussion in #1013 all unicode characters are valid label values - this commit allows the original path to be retained. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
24 lines
406 B
Go
24 lines
406 B
Go
package handlers
|
|
|
|
import "testing"
|
|
|
|
func Test_urlToLabel_normalizeTrailing(t *testing.T) {
|
|
have := "/system/functions/"
|
|
want := "/system/functions"
|
|
got := urlToLabel(have)
|
|
|
|
if got != want {
|
|
t.Errorf("want %s, got %s", want, got)
|
|
}
|
|
}
|
|
|
|
func Test_urlToLabel_retainRoot(t *testing.T) {
|
|
have := "/"
|
|
want := have
|
|
got := urlToLabel(have)
|
|
|
|
if got != want {
|
|
t.Errorf("want %s, got %s", want, got)
|
|
}
|
|
}
|