Bug 156125 - Fetching blob URLs with query parameters results in 404
Summary: Fetching blob URLs with query parameters results in 404
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari Technology Preview
Hardware: Mac OS X 10.11
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-01 19:16 PDT by Nolan Lawson
Modified: 2022-05-31 09:56 PDT (History)
5 users (show)

See Also:


Attachments
Reproducible test case (645 bytes, text/html)
2016-04-01 19:16 PDT, Nolan Lawson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nolan Lawson 2016-04-01 19:16:13 PDT
Created attachment 275457 [details]
Reproducible test case

Steps to repro:

1. Create a Blob
2. Create an object URL
3. Append a query param
4. Fetch it

Expected:

The Blob should be fetched normally, regardless of whether or not there are query params.

Actual:

The fetch resulted in a 404.

Notes:

There's no 404 in Firefox, but there is in Chrome.

URL to repro: http://bl.ocks.org/nolanlawson/2d6cdd75df91b04c49706e9abe2222a7
Comment 1 Nolan Lawson 2016-04-01 19:17:27 PDT
Equivalent issue in Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=600074
Comment 2 Nolan Lawson 2016-04-01 19:59:30 PDT
FWIW Edge throws an "Invalid argument" exception if you append a query string to a blob URL.
Comment 3 Brady Eidson 2016-04-01 22:30:16 PDT
(In reply to comment #0)
> Created attachment 275457 [details]
> Reproducible test case
> 
> Steps to repro:
> 
> 1. Create a Blob
> 2. Create an object URL
> 3. Append a query param
> 4. Fetch it
> 
> Expected:
> 
> The Blob should be fetched normally, regardless of whether or not there are
> query params.

This is not actually a forgone conclusion.

There's a relevant spec here - https://www.w3.org/TR/FileAPI/#DefinitionOfScheme - that defines what a valid blob url is.

A blob URL *MUST* consist of:
- The blob: scheme
- String representing the origin of the blob
- The character "/"
- String that is a UUID.

A blob URL *MAY* consist of:
- An optional fragment identifier

The language here is very short. If it's not in a "must" or a "may" section, one can extrapolate that it's a "must not".

> There's no 404 in Firefox, but there is in Chrome.

It seems like Firefox might get this wrong.

> FWIW Edge throws an "Invalid argument" exception if you append a query string to a blob URL.

It seems like Edge gets this "the most right"
Comment 4 Nolan Lawson 2016-04-02 07:53:49 PDT
Good point - the spec seems to leave this open for interpretation. Although I filed this issue based on principle of least surprise; I assumed query parameters would just be ignored.

Waiting to hear back from Chromium devs, but happy to file a bug on Firefox if there's a consensus on the interpretation. It's also pretty easy for web authors to work around, so not a very severe bug anyway.
Comment 5 Marijn Kruisselbrink 2017-12-06 06:28:48 PST
FWIW in https://github.com/w3c/FileAPI/pull/92 I'm working on making the spec a lot more explicit around Blob URL behavior, and currently I'm leaning towards making the webkit/blink/edge behavior the expected behavior; i.e. making fetching blob URLs with query parameters a network error.
Comment 6 Ahmad Saleem 2022-05-30 09:35:32 PDT
This bug should be closed since the spec change led to behavior being default to Webkit behavior, which was consistent across all browsers except Firefox. Please refer to http://crbug.com/600074 for further details.


Please mark this as "Resolved Invalid" or "WON'TFIX". Thanks!
Comment 7 Alexey Proskuryakov 2022-05-31 09:56:22 PDT
Thank you for checking!