Fully-qualified urls in HTTP Location header. Why

2019-07-17 19:17发布

问题:

So I've got some warnings from Fiddler that I have bad urls in HTTP Location header and they are should be fully-qualified. Why it's so important and what issues that can lead to?

回答1:

The old standard for HTTP/1.1 (RFC 2616 § 14.30) required that Location be an absolute URI.

Implementation experience showed that this was not important, and many implementations allowed relative URIs in Location, so the current standard (RFC 7231 § 7.1.2) allows relative URIs.