@@ -130,7 +130,7 @@ func TestSplitAllKeyValue(t *testing.T) {
130130}
131131
132132func TestNormalizePathRestrictAccesses (t * testing.T ) {
133- results , _ := normalizePathValues ([][]string {
133+ results , _ := normalizeAllPathValues ([][]string {
134134 {"/foo" , "host1" , "host2" },
135135 {"/foo/" , "host3" , "host4" },
136136 {"/bar" },
@@ -150,7 +150,7 @@ func TestNormalizePathRestrictAccesses(t *testing.T) {
150150func TestNormalizePathHeadersMap (t * testing.T ) {
151151 var result [][]string
152152
153- result , _ = normalizePathValues ([][]string {
153+ result , _ = normalizeAllPathValues ([][]string {
154154 {"/foo" , "X-header1" , "X-Value1" },
155155 {"/foo/" , "X-header2" , "X-Value2" },
156156 {"/bar" , "X-header3" , "X-Value3" },
@@ -217,6 +217,40 @@ func TestNormalizePathMaps(t *testing.T) {
217217 }
218218}
219219
220+ func TestDedupPathValues (t * testing.T ) {
221+ var result []string
222+
223+ result = dedupPathValues (nil )
224+ if ! expectStrings (result ) {
225+ t .Error (result )
226+ }
227+
228+ result = dedupPathValues ([]string {})
229+ if ! expectStrings (result ) {
230+ t .Error (result )
231+ }
232+
233+ result = dedupPathValues ([]string {"/foo" })
234+ if ! expectStrings (result , "/foo" ) {
235+ t .Error (result )
236+ }
237+
238+ result = dedupPathValues ([]string {"/foo" , "wow" })
239+ if ! expectStrings (result , "/foo" , "wow" ) {
240+ t .Error (result )
241+ }
242+
243+ result = dedupPathValues ([]string {"/foo" , "aa" , "bb" , "cc" })
244+ if ! expectStrings (result , "/foo" , "aa" , "bb" , "cc" ) {
245+ t .Error (result )
246+ }
247+
248+ result = dedupPathValues ([]string {"/foo" , "xx" , "yy" , "xx" , "zz" , "zz" , "/foo" })
249+ if ! expectStrings (result , "/foo" , "xx" , "yy" , "zz" , "/foo" ) {
250+ t .Error (result )
251+ }
252+ }
253+
220254func TestNormalizeFilenames (t * testing.T ) {
221255 files := []string {"" , "abc/def.txt" , "hello.txt" }
222256 normalized := normalizeFilenames (files )
0 commit comments