I have the following code in my index.py
urls = (
"/tasks/?$", "signin",
"/tasks/list", "listing",
"/tasks/post", "post",
... ...
)
Now having a problem I am debugging, the question I am asking now is
related to the problem. Please see the first line: "/tasks/?$" ... My
intention is to let it match either of the following
http://localhost/tasks
http://localhost/tasks/
I found, if I write "/tasks", then it won't work, because the browser
(or nginx) always send webpy the url http://localhost/tasks/, even if
I type in "http://localhost/tasks" (without the /).
Now I started to wonder, shall I put $ at the end of the regex? I did
that, it is still correct even for urls like:
http://localhost/tasks/?msg=Invalid%20username%20or%20password
In another word: regex matching is AFTER urlcracking, i.e., only the
PATH is being matched and parameters of the url is stripped off,
right? Which is to say, the regex we write in url() block is ALWAYS a
full-match and there is no need to write ^ or $?
I think it is full match, because, if it is not, then url like /tasks/
blahblah will also be matched my the first item?
Could you please help me confirm this?
Thank you!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---