diff options
| author | Chris McDonough <chrism@plope.com> | 2014-05-05 23:56:09 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2014-05-05 23:56:09 -0400 |
| commit | 7423971bf8aaa5fd205778820d91a6c7e3cea1bd (patch) | |
| tree | 35130316c871ff0d8c41c3ad57a5f5cc1d876c7c /docs/quick_tour | |
| parent | 7a6bf6f0ff1b85d0158ad49fc21037db4999c1cf (diff) | |
| parent | f9bc568657f316f20b5f576085472b80dec15cba (diff) | |
| download | pyramid-7423971bf8aaa5fd205778820d91a6c7e3cea1bd.tar.gz pyramid-7423971bf8aaa5fd205778820d91a6c7e3cea1bd.tar.bz2 pyramid-7423971bf8aaa5fd205778820d91a6c7e3cea1bd.zip | |
fix merge conflicts
Diffstat (limited to 'docs/quick_tour')
| -rw-r--r-- | docs/quick_tour/views/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/quick_tour/views/views.py b/docs/quick_tour/views/views.py index 9dc795f14..1449cbb38 100644 --- a/docs/quick_tour/views/views.py +++ b/docs/quick_tour/views/views.py @@ -1,3 +1,5 @@ +import cgi + from pyramid.httpexceptions import HTTPFound from pyramid.response import Response from pyramid.view import view_config @@ -14,7 +16,8 @@ def home_view(request): def hello_view(request): name = request.params.get('name', 'No Name') body = '<p>Hi %s, this <a href="/goto">redirects</a></p>' - return Response(body % name) + # cgi.escape to prevent Cross-Site Scripting (XSS) [CWE 79] + return Response(body % cgi.escape(name)) # /goto which issues HTTP redirect to the last view @@ -23,7 +26,7 @@ def redirect_view(request): return HTTPFound(location="/problem") -# /problem which causes an site error +# /problem which causes a site error @view_config(route_name='exception') def exception_view(request): raise Exception() |
