Closed AlexAltea closed 3 years ago
OK, yeah, that looks good. I seem to recall that's a violation of the http spec but I might be wrong and even so if people do it I guess we should handle it.
I might also use the URI.basedOn function which does all the relative handling (just like navigateTo) here.
Do you want the fix somewhat urgently? If no I'll take a look later to check a few more cases, if yes though I can merge and even tag another bug fix release now though.
Relative locations are allowed by the spec, cf. https://tools.ietf.org/html/rfc7231#section-7.1.2
7.1.2. Location
The "Location" header field is used in some responses to refer to a specific resource in relation to the response. The type of relationship is defined by the combination of request method and status code semantics.
Location = URI-reference
The field value consists of a single URI-reference. When it has the form of a relative reference ([RFC3986], Section 4.2), the final value is computed by resolving it against the effective request URI ([RFC3986], Section 5).
I might also use the URI.basedOn function which does all the relative handling (just like navigateTo) here.
Yeah, that sounds much better! I didn't know where to get an Uri
instance for the original request.
Do you want the fix somewhat urgently?
It's slightly urgent, as it's breaking some scripts, but I guess I can find find a temporary workaround in the meantime.
On Fri, Feb 26, 2021 at 07:23:51AM -0800, Alexandro Sanchez wrote:
Yeah, that sounds much better! I didn't know where to get an
Uri
instance for the original request.
if there isn't one I'll add one.
It's slightly urgent, as it's breaking some scripts, but I guess I can find find a temporary workaround in the meantime.
I'm just putting out another fire first then will return so give me a lil bit.
auto parts = where.basedOn(this.where);
this.where = parts;
I actually think throwing that into popupatFromInfo is going to do the trick. I'm doing my tests now. But if this.where is empty or if the new where is absolute, it uses the new one, otherwise it adapts these.
Gonna make a dummy server to actually confirm now then i'll push and tag.
Yeah it seems to work well. gonna close this and push that.
thanks for your help!
Sometimes the response
Location
header is/aaa/bbb
rather thanhttps://host:port/aaa/bbb
. This makes sure the provided URI is absolute before copying any data.