Skip to content

Commit

Permalink
Clarify intent of comment
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ Kells committed Nov 7, 2016
1 parent c307382 commit 88b2644
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion csp/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class CSPMiddleware(MiddlewareMixin):
"""
def _make_nonce(self, request, length=16):
# Return cached value if this has been executed already
# Ensure that any subsequent calls to request.csp_nonce return the
# same value
if not getattr(request, '_csp_nonce', None):
request._csp_nonce = get_random_string(length)
return request._csp_nonce
Expand Down

0 comments on commit 88b2644

Please sign in to comment.