Skip to content

Commit

Permalink
Merge pull request #5458 from camptocamp/fix-param-priority
Browse files Browse the repository at this point in the history
We shouldn't be able to override the parameter from the original URL
  • Loading branch information
sbrunner authored Nov 1, 2019
2 parents 41737e4 + d75c061 commit 24d5b58
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions geoportal/c2cgeoportal_geoportal/views/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ def _proxy(self, url, params=None, method=None, cache=False, body=None, headers=
# get query string
params = dict(self.request.params) if params is None else params
parsed_url = urllib.parse.urlparse(url)
all_params = urllib.parse.parse_qs(parsed_url.query)
for p in all_params: # pragma: no cover
all_params[p] = ",".join(all_params[p])
url_params = urllib.parse.parse_qs(parsed_url.query)
for p in url_params: # pragma: no cover
url_params[p] = ",".join(url_params[p])
all_params = {}
all_params.update(params)
all_params.update(url_params)
query_string = urllib.parse.urlencode(all_params)

if parsed_url.port is None:
Expand Down

0 comments on commit 24d5b58

Please sign in to comment.