Closed Bug 570017 Opened 14 years ago Closed 14 years ago

CSP report-uri with dotless host throws exception

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bsterne, Assigned: geekboy)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

CSP WARN:  couldn't parse report URI: http://bsterne/wordpress/wp-content/csp-process-report.php
[Exception... "Component returned failure code: 0x804b0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) [nsIEffectiveTLDService.getBaseDomain]"  nsresult: "0x804b0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS)"  location: "JS frame :: file:///build/m-c/ff-debug/dist/bin/modules/CSPUtils.jsm :: anonymous :: line 181"  data: no]
Attached patch fixSplinter Review
Dotless hosts don't play nice with the ETLD service... there's no "base domain" for a host that has no recognized TLD.  

The fix involves watching for when the ETLD service throws a fit, then just do a string comparison on the host to be sure that the report URI is on the same host as "self".  This is a fallback to same-origin restricting the report URI when the ETLD service isn't helpful.
Attachment #449110 - Flags: review?(bsterne)
Status: NEW → ASSIGNED
Comment on attachment 449110 [details] [diff] [review]
fix

r=dveditz
Attachment #449110 - Flags: review+
Attachment #449110 - Flags: review?(bsterne) → review+
http://hg.mozilla.org/mozilla-central/rev/ffceae16b1a7
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Is there any manual way to verify this fix or a script is required?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: