regex is not working in top level app
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web.py |
New
|
Undecided
|
Unassigned |
Bug Description
Bug report originally filed on git:
When using subapplications regexes, the top level url definitions behave differently then regexes in subapplications. This is an example based on code in http://
<b>blog.py:</b>
<pre>
import web
urls = (
"", "reblog",
"/(blog|Blog)", "blog" #change from original
)
class reblog:
def GET(self): raise web.seeother('/')
class blog:
def GET(self, path):
return "blog " + path
app_blog = web.application
</pre>
<b>code.py</b>
<pre>
import web
import blog
urls = (
"/(blog|Blog)", blog.app_blog, #change from original
# "/blog", blog.app_blog,
"/(.*)", "index"
)
class index:
def GET(self, path):
return "hello " + path
app = web.application
if __name__ == "__main__":
app.run()
</pre>
The regex /(blog|Blog) is the same in blog.py and code.py however request GET http://