From 180de88da1cafb1125c1f90286dae31e8233a148 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Sun, 3 Nov 2013 00:02:13 -0400 Subject: [PATCH] Tolerate extensions in URLs --- confluent/httpapi.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/confluent/httpapi.py b/confluent/httpapi.py index 6724a338..7fe074b4 100644 --- a/confluent/httpapi.py +++ b/confluent/httpapi.py @@ -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)