Skip to content

Commit

Permalink
DOC: Add cgi.escape to quick_tour/views/views.py (Fixes #1294)
Browse files Browse the repository at this point in the history
  • Loading branch information
westurner committed Apr 15, 2014
1 parent 133e75f commit f1f35b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/quick_tour/views/views.py
Expand Up @@ -2,6 +2,7 @@
from pyramid.response import Response
from pyramid.view import view_config

import cgi

# First view, available at http://localhost:6543/
@view_config(route_name='home')
Expand All @@ -14,7 +15,7 @@ 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)
return Response(body % cgi.escape(name))


# /goto which issues HTTP redirect to the last view
Expand Down

0 comments on commit f1f35b7

Please sign in to comment.