hi
Recently I've been having problem dealing with url like this:
http://example.com/app/ctrl/func/%E9%87%91%E5%B1%B1
you can see that the argument to the function is not alphabetical
characters. They are generated by encodeURIComponent in javascript
from non-English language. In this case, web2py failed to extract app,
ctrl and func from the url and gave an "Invalid request" in return.
I find this problem related to regex_url in gluon/main.py: (I
compressed it for display)
regex_url =
re.compile("(^(/(?P<a>\w+)(/(?P<c>\w+)(/(?P<f>\w+)(\.(?P<e>\w+))?(/(?P<s>([\...@][\=\./]?)+))?)?)?)?/?$)",
re.X)
so I changed it to:
regex_url =
re.compile("(^(/(?P<a>\w+)(/(?P<c>\w+)(/(?P<f>\w+)(\.(?P<e>\w+))?(/(?P<s>(.+)))?)?)?)?/?$)",
re.X)
and it works well.
What do you think mdipierro? Did I miss anything?
--
Luyun Xie
谢路云
http://magefromhell.blogspot.com/
(http://blog.hellmage.info/)
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.