-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Refactor on csp_nonce usage with django-csp #2088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
89b51bf
c1bd360
aa229c0
43ec028
f0b2f61
98678de
18c53ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ backends | |
| backported | ||
| checkbox | ||
| contrib | ||
| csp | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think my note in the changelog triggered it as a word despite being |
||
| dicts | ||
| django | ||
| fallbacks | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,11 @@ def regular_view(request, title): | |
| return render(request, "basic.html", {"title": title}) | ||
|
|
||
|
|
||
| def csp_view(request): | ||
| """Use request.csp_nonce to inject it into the headers""" | ||
| return render(request, "basic.html", {"title": f"CSP {request.csp_nonce}"}) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The nonce needed to be rendered in the view. I chose to do it here. |
||
|
|
||
|
|
||
| def template_response_view(request, title): | ||
| return TemplateResponse(request, "basic.html", {"title": title}) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this comment is now out of date - no private attribute is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Good catch!