Skip to content

Commit

Permalink
looks like we need to urlunqoute incoming args from routes
Browse files Browse the repository at this point in the history
  • Loading branch information
guyromm committed Aug 23, 2011
1 parent 0b9a8ef commit bd7082c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dispatcher.py
Expand Up @@ -3,7 +3,7 @@
'''
from noodles.http import Error404
from noodles.templates import Templater
import sys, os
import sys, os,urllib

# Add standard controllers dir to PYTHON_PATH directory
sys.path.append( os.path.join(os.path.dirname(__file__), 'controllers') )
Expand Down Expand Up @@ -52,12 +52,16 @@ def get_callable(self, request):
if not controller: raise Exception('No such controller \'%s\'' % controller_name)

# Prepare extra args for callable

extra_args = route_res.copy() # copying all data from routes dictionary
for k,v in extra_args.items():
extra_args[k] = urllib.unquote(v).decode('utf8')
# Delete controller and action items
del extra_args['controller']; del extra_args['action']
extra_args['request'] = request

callable_obj = CallWrapper(controller, action, extra_args)

return callable_obj

def not_found(self, request):
Expand Down
2 changes: 1 addition & 1 deletion websocket/websockhandler.py
Expand Up @@ -97,7 +97,7 @@ def __call__(self, env, start_response):
except Exception as e:
f = logging.Formatter()
traceback = f.formatException(sys.exc_info())
logging.error('Servelet fault: \n%s' % traceback)
logging.error('Servlet fault: \n%s' % traceback)
break

if data:
Expand Down

0 comments on commit bd7082c

Please sign in to comment.