-
Notifications
You must be signed in to change notification settings - Fork 38
Use FETCH#URL to describe the name of a request #257
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
Conversation
Instead of specifying here that it's the URL before redirects, which is essentially the same thing. See #244
"HTML#resolve-a-url">resolved URL</a> of the requested resource. | ||
This attribute MUST NOT change even if the <a data-cite= | ||
"FETCH#concept-fetch">fetch</a> redirected to a different URL.</dd> | ||
"FETCH#concept-request-url">URL</a> of the resource's <a data-cite= |
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.
Looking at https://fetch.spec.whatwg.org/#concept-request-url I don't see it being explicitly set to the first URL in the list, and there's a note saying "implementations are encouraged" to do that. As such, I don't know if this is something we want to rely on. Maybe we should explicitly point to the first URL in the URLList?
/cc @annevk for his opinions
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.
Seems like URL
is set to be exactly that, judging by the fact that during redirects it's not changed.
But I would let @annevk confirm.
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.
Yeah, looking closer it seems to be set in the Request constructor and not modified on redirects.
I'm not sure what "resource" is, but I suspect it's a response. Assuming I'm right, I think you want to get data from the response and not assume that the response has access to the request. |
There's a plan to clarify that as part of #252, but I don't know we have a full design for that just yet.
Would it make sense then to grab the first item from [https://fetch.spec.whatwg.org/#concept-response-url-list](Response's URL list)? |
Yeah, probably, if you can be certain it's non-empty (i.e., you do not access it when fetch hasn't returned it yet). |
It might be good to start from #252 then, it would clarify a lot of these issues, as the request/response etc will probably be a parameter passed from FETCH at a particular point in time. |
Instead of specifying here that it's the URL before redirects,
which is essentially the same thing.
Closes #244
Preview | Diff