Closed
Bug 1013559
Opened 11 years ago
Closed 11 years ago
Support both CSP parsers coexisting
Categories
(Core :: DOM: Security, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: grobinson, Assigned: ckerschb)
References
Details
Attachments
(1 file, 1 obsolete file)
|
2.26 KB,
patch
|
ckerschb
:
review+
|
Details | Diff | Splinter Review |
Part of our landing plan for CSP is the we should be able to parse 1.x headers with the new parser while still supporting parsing X-CSP with the old parser. The current code prevents this behavior because it aborts on receiving X-CSP if the newBackend pref is flipped (currently on nsDocument.cpp:2808, may rot). We should change this so we use the old backend for X-CSP and the new backend for CSP (if the newBackend pref is true).
| Reporter | ||
Updated•11 years ago
|
Assignee: nobody → mozilla
| Assignee | ||
Comment 1•11 years ago
|
||
Uses the new (C++) backend (if available) for CSP 1.* policies while falling back to the old (JS) implementation for XCSP headers.
Attachment #8425820 -
Flags: review?(sstamm)
Attachment #8425820 -
Flags: review?(grobinson)
| Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 8425820 [details] [diff] [review]
bug_1013559.patch
Review of attachment 8425820 [details] [diff] [review]:
-----------------------------------------------------------------
lgtm! Consider removing the unnecessary PR logging, but r=me either way.
::: content/base/src/nsDocument.cpp
@@ +2816,5 @@
> #ifdef PR_LOGGING
> PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s",
> + "This document uses the deprecated x-content-security-policy header",
> + "which will not be supported in the future."
> + "Please update the document to use CSP 1.* compliant headers."));
I don't think we need to PRLOG about deprecated headers. The audience for PRLOG is Firefox developers, while the people who are typically concerned with setting headers are web developers. We already log to the Web Console for their benefit if they use deprecated CSP headers, on nsDocument.cpp:2730.
Attachment #8425820 -
Flags: review?(grobinson) → review+
| Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Garrett Robinson [:grobinson] from comment #2)
> Comment on attachment 8425820 [details] [diff] [review]
> bug_1013559.patch
>
> Review of attachment 8425820 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> lgtm! Consider removing the unnecessary PR logging, but r=me either way.
>
> ::: content/base/src/nsDocument.cpp
> @@ +2816,5 @@
> > #ifdef PR_LOGGING
> > PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s",
> > + "This document uses the deprecated x-content-security-policy header",
> > + "which will not be supported in the future."
> > + "Please update the document to use CSP 1.* compliant headers."));
>
> I don't think we need to PRLOG about deprecated headers. The audience for
> PRLOG is Firefox developers, while the people who are typically concerned
> with setting headers are web developers. We already log to the Web Console
> for their benefit if they use deprecated CSP headers, on nsDocument.cpp:2730.
Haha, I really thought is console logging. Will remove that right away. Thanks!
Comment 4•11 years ago
|
||
Comment on attachment 8425820 [details] [diff] [review]
bug_1013559.patch
Review of attachment 8425820 [details] [diff] [review]:
-----------------------------------------------------------------
I strongly encourage running this through try.
Attachment #8425820 -
Flags: review?(sstamm) → review+
| Assignee | ||
Comment 5•11 years ago
|
||
Carrying over the r+ from grobinson and sstamm.
Even though this is a one line change, we are going to run this everywhere on try to make sure it's working as expected:
https://tbpl.mozilla.org/?tree=Try&rev=e16633a51898
Attachment #8425862 -
Flags: review+
| Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8425820 [details] [diff] [review]
bug_1013559.patch
Marking the first patch as obsolete.
Attachment #8425820 -
Attachment is obsolete: true
| Assignee | ||
Comment 7•11 years ago
|
||
Try looks good to me, this is ready to land!
Keywords: checkin-needed
Comment 8•11 years ago
|
||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 9•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•