mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibWeb: Don't return an opaque origin for file:// URLs
The protocol of the origin is used for checking if the a file://
iframe is allowed to be loaded (a document with a file:// origin
can load other files in iframes).
This used to be the case, but was changed in
6e71e400e6
, which broke file:// iframes.
This commit is contained in:
parent
8d2c2f7c52
commit
965237efb8
1 changed files with 2 additions and 1 deletions
|
@ -52,7 +52,8 @@ static HTML::Origin url_origin(AK::URL const& url)
|
|||
|
||||
if (url.scheme() == "file"sv) {
|
||||
// Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin.
|
||||
return HTML::Origin {};
|
||||
// Note: We must return an origin with the `file://' protocol for `file://' iframes to work from `file://' pages.
|
||||
return HTML::Origin(url.protocol(), String(), 0);
|
||||
}
|
||||
|
||||
return HTML::Origin {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue