Closed Bug 1916642 Opened 10 months ago Closed 9 months ago

Requests caused by redirects have the same request ID in webRequest.onSendHeaders and webRequest.onHeadersReceived

Categories

(WebExtensions :: Request Handling, defect)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: misc, Unassigned)

Details

Attachments

(3 files)

Attached file MRE Extension

Steps to reproduce:

  1. Download Firefox Nightly (Build ID: Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0 ID:20240903210242)
  2. Install an extension that uses webRequest.onSendHeaders and/or webRequest.onHeadersReceived which logs duplicate request IDs (an example is provided in the attachment "MRE extension"/"ffb.zip")
  3. Go to about:debugging -> "This Firefox" -> "Inspect" on the extension
  4. In the main Firefox window, navigate to a URL which causes a redirect

Actual results:

Both webRequest.onSendHeaders and webRequest.onHeadersReceived are fired twice each. The request IDs for the request that caused the redirect, and the request which is redirected to are the same.

Expected results:

Both webRequest.onSendHeaders and webRequest.onHeadersReceived are fired twice each. The request IDs for the request that caused the redirect, and the request which is redirected to should've been different.

Component: Untriaged → Request Handling
OS: Unspecified → Linux
Product: Firefox → WebExtensions
Hardware: Unspecified → x86_64
Attached file MRE Redirect Server
Status: UNCONFIRMED → NEW
Ever confirmed: true

Needinfo-ing Rob to take a look into this.

Flags: needinfo?(rob)

The requestId being constant across redirects is intentional and documented:

It stays the same throughout a request, even across redirections and authentication exchanges.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest

Status: NEW → RESOLVED
Closed: 9 months ago
Flags: needinfo?(rob)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: