File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ func FilterCustomQuery(u *nurl.URL) *nurl.URL {
53
53
ux := * u
54
54
vx := make (nurl.Values )
55
55
for k , v := range ux .Query () {
56
- if len (k ) <= 1 || ( len ( k ) > 1 && k [0 :2 ] != "x-" ) {
56
+ if len (k ) <= 1 || k [0 :2 ] != "x-" {
57
57
vx [k ] = v
58
58
}
59
59
}
Original file line number Diff line number Diff line change @@ -21,12 +21,15 @@ func TestSuint(t *testing.T) {
21
21
}
22
22
23
23
func TestFilterCustomQuery (t * testing.T ) {
24
- n , err := nurl .Parse ("foo://host?a=b&x-custom=foo&c=d" )
24
+ n , err := nurl .Parse ("foo://host?a=b&x-custom=foo&c=d&ok=y " )
25
25
if err != nil {
26
26
t .Fatal (err )
27
27
}
28
28
nx := FilterCustomQuery (n ).Query ()
29
29
if nx .Get ("x-custom" ) != "" {
30
30
t .Fatalf ("didn't expect x-custom" )
31
31
}
32
+ if nx .Get ("ok" ) != "y" {
33
+ t .Fatalf ("expected ok=y, got %v" , nx .Get ("ok" ))
34
+ }
32
35
}
You can’t perform that action at this time.
0 commit comments