gcodeforks / webapp-improved

Automatically exported from code.google.com/p/webapp-improved
Other
0 stars 0 forks source link

%0A in a URL does not match an appserver pattern of /(.*) #75

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a webapp like this.

app = webapp.WSGIApplication([
   ('/(.*)', lookup.SnippyHandler),
   ])

I'd expect that to match any URL at all

but the url

/hello%0Aworld

does not match it throws a 404

this is because %0A is \n
and that breaks the . in the re since it doesn't match newlines

we should add re.MULTILINE to the re.match call to catch this.

a workaround is to have a line like this
('/((.|\n)*)', lookup.SnippyHandler),
but that changes the signature of SnippyHandler to require 3 arguments

other people see this too

https://groups.google.com/forum/#!msg/google-appengine/80N_Ah2Jxtw/fOdBNrzgQJgJ

Original issue reported on code.google.com by a...@google.com on 27 Feb 2013 at 6:36