WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
282427
Service Worker can't correctly redirect relative URLs
https://bugs.webkit.org/show_bug.cgi?id=282427
Summary
Service Worker can't correctly redirect relative URLs
Bero
Reported
2024-11-01 02:05:47 PDT
Created
attachment 473100
[details]
Error in the network request When I use a Service Worker for 300 redirects it works well when the Location header is set to an absolute URL like
http://localhost/redirect.html
, but the request returns an error when I set the location header to a relative URL like /redirect.html. Relative URL redirects work in both Firefox and Chrome, just not in Safari. If a relative URL location header is returned by a server like Apache the redirect will work. This is why I assume the issue is specifically related to Service Workers. Here is a repository with a minimal example of the issue
https://github.com/bgrgicak/service-worker-redirect-test
and testing instruction.
Attachments
Error in the network request
(244.47 KB, image/png)
2024-11-01 02:05 PDT
,
Bero
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-11-08 01:06:15 PST
<
rdar://problem/139498279
>
youenn fablet
Comment 2
2024-11-08 02:12:52 PST
One temporary workaround is to use Response.redirect instead. This will autocomplete the URL in the location header.
Bero
Comment 3
2024-11-11 02:08:44 PST
(In reply to youenn fablet from
comment #2
)
> One temporary workaround is to use Response.redirect instead. This will > autocomplete the URL in the location header.
Thank you! I can confirm the workaround works.
EWS
Comment 4
2024-11-11 23:49:14 PST
Committed
286470@main
(8aeae6caf539): <
https://commits.webkit.org/286470@main
> Reviewed commits have been landed. Closing PR #36386 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug