Skip to content

Commit

Permalink
Merge pull request Netflix#199 from ausmith/1.x
Browse files Browse the repository at this point in the history
Handle query params without an `=`
  • Loading branch information
kerumai committed Apr 6, 2016
2 parents 80eb6da + 11ae37f commit 70bae0b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,15 @@ class SimpleHostRoutingFilter extends ZuulFilter {
if (rebuiltQueryString.length() > 0) {
rebuiltQueryString = rebuiltQueryString + "&"
}
def (name,value) = keyPair.split("=", 2)
if (value != null) {

if (keyPair.contains("=")) {
def (name,value) = keyPair.split("=", 2)
value = URLDecoder.decode(value, encoding)
value = new URI(null, null, null, value, null).toString().substring(1)
value = value.replaceAll('&', '%26')
rebuiltQueryString = rebuiltQueryString + name + "=" + value
} else {
name = URLDecoder.decode(name, encoding)
def value = URLDecoder.decode(keyPair, encoding)
value = new URI(null, null, null, value, null).toString().substring(1)
rebuiltQueryString = rebuiltQueryString + value
}
Expand Down

0 comments on commit 70bae0b

Please sign in to comment.