Skip to content

Commit

Permalink
Do not split query strings on ; anymore.
Browse files Browse the repository at this point in the history
Using `;` as a separator instead of `&` was allowed a long time ago,
but is now obsolete and actually invalid according to the 2014 W3C
recommendations. Even if this change is technically backwards-incompatible,
no real-world application should depend on broken behavior. If you REALLY
need this functionality, monkey-patch the _parse_qsl() function.
  • Loading branch information
defnull committed Nov 11, 2020
1 parent 2d6acef commit 57a2f22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2585,7 +2585,7 @@ def parse_range_header(header, maxlen=0):

def _parse_qsl(qs):
r = []
for pair in qs.replace(';','&').split('&'):
for pair in qs.split('&'):
if not pair: continue
nv = pair.split('=', 1)
if len(nv) != 2: nv.append('')
Expand Down

0 comments on commit 57a2f22

Please sign in to comment.