Making GURL::inner_url() works with blob URL. |
|||||
Issue description* GURL::inner_url() doesn't handle blob-url (only filesystem-url currently) * KURL::innerUrl() does the job. Does someone knows if there is something that prevent us to make it works? Tomorrow, I will have to implement it for checking CSP on the browser-side.
,
Feb 9 2017
,
Feb 9 2017
I said something wrong: KURL::innerUrl() doesn't work with blob-url.
But static SecurityOrigin::extractInnerURL(KURL) does the job though.
Sorry if I confuse someone.
```
KURL SecurityOrigin::extractInnerURL(const KURL& url) {
if (url.innerURL())
return *url.innerURL();
// FIXME: Update this callsite to use the innerURL member function when
// we finish implementing it.
return KURL(ParsedURLString, url.path());
}
```
I will probably use the same trick for the moment and come back later.
If we want to make GURL::inner_url working with blob-url, we will have to make something similar to
void DoParseFileSystemURL(const CHAR* spec, int spec_len, Parsed* parsed) in url/third_party/mozzilla/url_parse.cc
,
Feb 9 2017
The historical reasons are basically that the person who implemented the inner URL functionality was working on `filesystem:` and didn't know/care about `blob:`. :) We should indeed fill this gap.
,
Feb 9 2017
#3: url::Origin handles blob URLs by using GURL::GetContent (https://cs.chromium.org/chromium/src/url/origin.cc?l=50), which is essentially everything after the scheme, so you could just use that, right?
,
Feb 10 2017
Yes probably, but it might be slightly different, I don't know.
For instance if url = GURL("filesystem:http://example.com/path?query#ref) then
url.inner_url()->query() == "";
url.inner_url()->ref() == "";
url.inner_url()->path() == "/path%3Fquery%23ref"
which is not what you can expect if GURL::inner_url = function() { return GURL(GetContent()); }
Maybe blob-url are special, at least as much as filesystem-url?
N.B.#1 In your example, it is okay since only the scheme/host/port are used and not the path.
N.B.#2 For the moment, I will use a translation of SecurityOrigin::extractInnerURL for GURL, but GURL::GetContent would work too I think.
,
Feb 12 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 12 2018
I am archiving the bug because it is unlikely someone to be still interested in making GURL::inner_url() working with blob URL. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by alex...@chromium.org
, Feb 8 2017