Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
Security and CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Feb 17, 2017
1 parent 8ec626b commit 6791cb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rsanic/rsanic.py
Expand Up @@ -52,9 +52,9 @@ async def handler(self, request, **args):
return_type = handler['return_type']
except KeyError:
return_type = self.config.default_return_type
module_name, class_name = handler['controller'].rsplit(".", 1)
handler_parts = handler['controller'].rsplit(".", 1)
module_path = handler['controller']
controller_obj = getattr(importlib.import_module(module_path), class_name.title())
controller_obj = getattr(importlib.import_module(module_path), handler_parts[1].title())
controller = controller_obj(container=self.container, request=request)
controller.application_global()
controller.controller_global()
Expand All @@ -70,7 +70,7 @@ async def handler(self, request, **args):
def html_response(self, handler, controller_response):
bcc = FileSystemBytecodeCache()
loader = FileSystemLoader(self.config['app_dir'] + '/templates')
jinja = Environment(bytecode_cache=bcc, loader=loader)
jinja = Environment(bytecode_cache=bcc, loader=loader, autoescape=True)
jinja.globals['config'] = self.config
template_path = handler['controller'].replace('.', '/') + '.html'
template = jinja.get_template(template_path)
Expand Down

0 comments on commit 6791cb0

Please sign in to comment.