URL mapping regex don't match newlines

Bug #257187 reported by Andrew Trusty
2
Affects Status Importance Assigned to Milestone
web.py
Confirmed
Medium
Anand Chitipothu

Bug Description

I'm using some crazy urls that have stuff like newlines in them. These urls can't be mapped in webpy using a regex with a dot because I can't specify the regex flag re.DOTALL.

My quick fix for 0,23 was to set this flag to the regex compilation on line 333 of utils.py. It looks like the dev version might require more work with the _match function in application.py

Revision history for this message
Aaron Swartz (aaronsw) wrote : Re: [Bug 257187] [NEW] URL mapping regex don't match newlines

Did things actually work once you added re.DOTALL? I would have
thought any newlines would have to be encoded in the URL...

Revision history for this message
Andrew Trusty (andrewtrusty) wrote :

Things are working with the added re.DOTALL. I am using url encoded
newlines but the regex must be matching on the decoded url because it
wouldn't match my urls.

For example, the following url isn't matched by the regex
'/verify/(.+)' without the re.DOTALL ('%0A' is an encoded newline).

http://localhost:8080/verify/WFVkSj%0AU7x0=

Revision history for this message
Aaron Swartz (aaronsw) wrote :

Should be a simple fix.

Changed in webpy:
assignee: nobody → anandology
importance: Undecided → Medium
status: New → Confirmed
Changed in webpy:
milestone: none → 0.35
Aaron Swartz (aaronsw)
Changed in webpy:
milestone: 0.35 → 0.31
Changed in webpy:
milestone: 0.32 → 0.33
Revision history for this message
Anand Chitipothu (anandology) wrote :

Looked like I need to add additional argument to utils.re_subm and change all call to it.

I prefer to postpone this change to 0.34/0.35.

Changed in webpy:
milestone: 0.33 → 0.35
Changed in webpy:
milestone: 0.35 → 0.34
Changed in webpy:
milestone: 0.34 → 0.35
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.