2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-15 12:17:47 +00:00

Tolerate extensions in URLs

This commit is contained in:
Jarrod Johnson 2013-11-03 00:02:13 -04:00
parent 3fa61dc8f9
commit 180de88da1

View File

@ -201,9 +201,12 @@ def resourcehandler(env, start_response):
else:
# normal request
operation = opmap[env['REQUEST_METHOD']]
resource = '.' + env['PATH_INFO'][env['PATH_INFO'].rindex('/'):]
url = env['PATH_INFO']
url = url.replace('.json', '')
url = url.replace('.html', '')
resource = '.' + url[url.rindex('/'):]
try:
hdlr = pluginapi.handle_path(env['PATH_INFO'], operation,
hdlr = pluginapi.handle_path(url, operation,
cfgmgr, querydict)
except exc.NotFoundException:
start_response('404 Not found', headers)