Response `redirected` attribute set incorrectly for intercepted requests

RESOLVED DUPLICATE of bug 1222008

Status

()

defect
P2
normal
RESOLVED DUPLICATE of bug 1222008
2 years ago
a year ago

People

(Reporter: jugglinmike, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Posted file sw-redirect.py
When a service worker intercepts a request and provides a response by
performing a fetch, the response's `redirected` attribute should reflect
whether a redirect occurred. In Firefox today, the attribute is incorrectly set
to `false` in cases where the service worker provides a response that was the
result of an HTTP 302 redirect.

Attached, please find a Python script that creates a web server for
demonstration purposes. It may be invoked with Python 2.7 as follows:

    python sw-redirect.py

And subsequently accessed by navigating to `http://localhost:9000`.
Demonstration results are printed to the developer's console.

Expected:

    In worker:
    > response.type = basic
    > response.status = 200
    > response.redirected = true
    In client:
    > response.type = basic
    > response.status = 200
    > response.redirected = true

Actual:

    In worker:
    > response.type = basic
    > response.status = 200
    > response.redirected = true
    In client:
    > response.type = basic
    > response.status = 200
    > response.redirected = false

System information:

- Firefox: 55.0a1 (2017-05-12) (64-bit)
- Platform: GNU/Linux (Ubuntu 16.04)
So if I'm reading this right, the Response returned in the outer window is the one with the wrong .redirected value.

So this is a bug in our code that synthesizes nsIChannel from Response in SW and then extracts Response back from nsIChannel on the main thread.
Priority: -- → P2
Fixed by bug 1222008.
No longer blocks: ServiceWorkers-compat
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1222008
You need to log in before you can comment on or make changes to this bug.