-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibWeb: Partition Blob URL fetches by Storage Key #3303
Conversation
bb21920
to
36c4a08
Compare
bool is_top_level_navigation = request->destination() == Infrastructure::Request::Destination::Document; | ||
|
||
// 5. If isTopLevelNavigation is false and requestEnvironment is null, then return a network error. | ||
if (is_top_level_navigation && !request_environment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be !is_top_level_navigation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof, yes it should, good spot, thanks! Now I need to figure out how to write a test for this one, doesn't seem trivial with my current understanding of fetch 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to find any method of trigging this, every caller of fetch that I can see from a search sets the client of the request. So I've just pushed a fix for now.
Did happen to find a bug with not supporting blob URLs when trying to find a repro for this, will raise a separate PR for that.
Instead of just putting in members directly, wrap them up in structs which represent what a URL blob entry is meant to hold per the spec. This makes more obvious what this is meant to represent, such as the ByteBuffer being used to represent the bytes behind a Blob. This also allows us to use a stronger type for a function that needs to return a Blob URL entry's object.
When we serialize blob URL entries we do not serialize the entire environment settings object and only use it's origin. To allow a Blob URL entry to access its relevant storage key, add a getter that simply takes an origin.
This was a security mechanism introduced in the fetch spec, with supporting AOs added to the FileAPI spec.
36c4a08
to
f0dad7f
Compare
This was a security mechanism introduced in the fetch spec, with
supporting AOs added to the FileAPI spec.