Skip to content
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

Preserve fragment in Request/Response URLs #214

Closed
ParkFramework opened this issue Feb 16, 2016 · 10 comments
Closed

Preserve fragment in Request/Response URLs #214

ParkFramework opened this issue Feb 16, 2016 · 10 comments

Comments

@ParkFramework
Copy link

Removing #hash of URL, it prevents to use history API:

fetch("url#hash").then(response => history.pushState(null, null, response.url))

The server redirect, response.url needed use, that correct display url in address bar.
I do propose to not delete the #hash, it will be more convenient in practice.

Request.url and Response.url should be similarly URL.href (within #hash)

@wanderview
Copy link
Member

Are hashes maintained through server side redirects for xhr? Or another existing API?

@annevk
Copy link
Member

annevk commented Feb 16, 2016

Yeah, they are. I guess we should probably revert this "fetch URL" thing. 😟

@ParkFramework
Copy link
Author

All is well, the only problem auto deletion #hash from Request.url

new Request('/url#hash') // request.url === 'http://example.org/url' (without #hash)

@wanderview
Copy link
Member

If we make this change I worry about places in service worker spec where we might be relying on the hash being removed from the url.

@annevk
Copy link
Member

annevk commented Feb 16, 2016

@jungkees @jakearchibald any thoughts on the above comment from @wanderview?

@wanderview
Copy link
Member

I know we had a previous issue about removing the spec from service worker script. Maybe all that stuff is explicit, but I know we've depended on fetch spec to have certain side effects before for other things. I guess its just something to double-check.

@wanderview
Copy link
Member

I guess this would expose the hashes to the fetch event where previously they were not exposed.

It also creates a new requirement on Cache API to store hashes. The Cache match algorithm would also have to be updated to take into account hashes.

@annevk annevk changed the title Not delete, the hash url in Request and Response Preserve fragment in Request/Response URLs Mar 24, 2016
@annevk
Copy link
Member

annevk commented May 4, 2016

Note that I argued in w3c/ServiceWorker#854 (comment) that responses never have a fragment identifier. What happens with redirects is that the fragment from the Location header URL can end up being important. Not a fragment on a response, which isn't really a thing.

annevk added a commit that referenced this issue Jun 9, 2016
Fixes #214. Though only for request URLs as exposing the fragment on a
response is not an accurate representation of what happens.
@annevk annevk closed this as completed in 111da37 Jun 9, 2016
@wanderview
Copy link
Member

@mfalken
Copy link

mfalken commented May 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants