Summary: | Worker.constructor throws an exception when the url param is an empty string | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | zyscoder <zyscoder> | ||||||
Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, bugs-noreply, cdumez, darin, ggaren, mcatanzaro, sam, webkit-bug-importer, youennf | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Local Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=27887 | ||||||||
Attachments: |
|
Description
zyscoder@gmail.com
2021-06-04 02:58:42 PDT
Created attachment 430625 [details]
Patch
Comment on attachment 430625 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430625&action=review > LayoutTests/fast/workers/worker-constructor-expected.txt:1 > +CONSOLE MESSAGE: SyntaxError: Unexpected token '<' I saw this in Chrome. In Firefox I see this: Loading Worker from “http://example.com/” was blocked because of a disallowed MIME type (“text/html”). (In reply to Alex Christensen from comment #2) > Comment on attachment 430625 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=430625&action=review > > > LayoutTests/fast/workers/worker-constructor-expected.txt:1 > > +CONSOLE MESSAGE: SyntaxError: Unexpected token '<' > > I saw this in Chrome. In Firefox I see this: > Loading Worker from “http://example.com/” was blocked because of a > disallowed MIME type (“text/html”). Either way, the browser attempts treats the input as a relative URL and ends up trying to load the test page URL in a Worker. Looks like Blink and WebKit just ignore the fact that the response is text/html and still try to process it as a worker script, while Firefox gives up after seeing the Content-Type. Created attachment 430633 [details]
Patch
Committed r278520 (238519@main): <https://commits.webkit.org/238519@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430633 [details]. |