質問

For an http redirection, say a 302, is it mandatory to return the full url of the new page, including http:// or is it possible to only send a relative address to the root url, like /my/view ?

I tried to read rfc 2616 at http://tools.ietf.org/html/rfc2616#section-10.3.3 but could find anything explicit.

Also, are there known browsers bugs regarding this ?

役に立ちましたか?

解決

Actually, RFC 2616 is clear in that it needs to be a full URI (by citing the relevant ABNF production from the URI spec).

That being said, this is nowadays considered a bug, and the next revision of HTTP will allow relative references. And yes, browsers support those.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top