Closed Bug 1607936 Opened 5 years ago Closed 5 years ago

XHR requests sending "null" Origin from addon background script

Categories

(WebExtensions :: Request Handling, defect)

73 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1607154

People

(Reporter: anoakie, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached file test-fail.zip (deleted) —

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0

Steps to reproduce:

I attempted to make an XMLHttpRequest to one of our APIs from a persistent background script in our Firefox Addon and I unexpectedly got an error because of a "null" Origin. I'm also able to reproduce this with the fetch() API.

Minimal test case attached.

Actual results:

"Origin: null" was sent in the header.

The following error occurred:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://events-api.mix.com/v1/t. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘null’).

Expected results:

"Origin: moz-extension://HASH" should have been sent in the header

No error should have occurred

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Product: Firefox → WebExtensions

Reproduced the issue on latest Firefox Nightly 74.0a1 (2020-01-09) (64-bit) and Beta 73.0b2 (64-bit) on Windows 10 x64.
This seems like a recent regression, it works well on the latest Release 72.0.1 (64-bit).
Attached screenshots for reference.

Thanks for the report anoakie!

Status: UNCONFIRMED → NEW
Has Regression Range: --- → no
Has STR: --- → yes
Component: Untriaged → DOM: Networking
Ever confirmed: true
Product: WebExtensions → Core
Attached image Actual Result (deleted) —
Attached image Expected result (deleted) —

Ah, this seems like a Duplicate of Bug 1607154.
Regression range found using this testcase: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=0f6958f498427fad830cdf94e279d8acd16402c9&tochange=f09f24f2b545919ab0db4bd352c276779c58bcc6

Regression range contains Bug 1405971 which causes this issue.
Closing it as duplicate.

Status: NEW → RESOLVED
Has Regression Range: no → yes
Closed: 5 years ago
Regressed by: 1405971
Resolution: --- → DUPLICATE

Sorry for the spam, forgot to correct component.

Component: DOM: Networking → Request Handling
Product: Core → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: