Skip to content

Commit

Permalink
Facebook Marketing #5190 - check if query params have values while re…
Browse files Browse the repository at this point in the history
…move params from url
  • Loading branch information
vitaliizazmic committed Aug 31, 2021
1 parent 5a0d7af commit 8a64aca
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ def remove_params_from_url(url, params):
parsed_url = urlparse.urlparse(url)
res_query = []
for q in parsed_url.query.split("&"):
key, value = q.split("=")
if key not in params:
res_query.append(f"{key}={value}")
if len(q.split("=")) == 2:
key, value = q.split("=")
if key not in params:
res_query.append(f"{key}={value}")

parse_result = parsed_url._replace(query="&".join(res_query))
return urlparse.urlunparse(parse_result)
Expand Down

0 comments on commit 8a64aca

Please sign in to comment.