'Refresh' HTTP header

HttpHttp Headers

Http Problem Overview


I'm automating a web application (the Mantis bug tracker) and I'm getting an interesting response header from it, called Refresh:

HTTP/1.x 200 OK
...
Refresh: 0;url=my_view_page.php

It seems to be acting the same way that meta refresh does, and the meta refresh technique implies that it is an equivalent of a header in HTTP.

Problem is, I can't find any mention of the Refresh header in the HTTP standard or any other definitive documentation on how it should be parsed and what the browser should do when it encounters it.

What's going on here?

Http Solutions


Solution 1 - Http

As far as I know, Refresh (along with Set-Cookie and possibly some other proprietary pseudo-headers) were created by Netscape in the very early days of the internet and have been basically (but not quite) standard since then. Because just about every browser supports it, Refresh is pretty safe to use -- and commonly is.

I guess it never became part of the official standards because they already had provisions for that with the status codes.

Solution 2 - Http

from the W3C HTML 4.01 specification, quote: >META and HTTP headers > >The http-equiv attribute can be used in place of the name attribute and has a special significance when documents are retrieved via the Hypertext Transfer Protocol (HTTP). HTTP servers may use the property name specified by the http-equiv attribute to create an [RFC822]-style header in the HTTP response. Please see the HTTP specification ([RFC2616]) for details on valid HTTP headers.

What this means is that when you use the <meta http-equiv="refresh" url="..."/> tag, you are actually instructing the browser to act as if there were a Refresh header being sent.

a good overview of the history of it can be found at http://www.securiteam.com/securityreviews/6Z00320HFQ.html

Solution 3 - Http

According to http://en.wikipedia.org/wiki/URL_redirection#Refresh_Meta_tag_and_HTTP_refresh_header">Wikipedia: URL Redirection:

> This is a proprietary/non-standard > extension by Netscape. It is supported > by most web browsers.

Solution 4 - Http

I believe it was originally a Netscape extension, and was not standardised because it's deprecated by W3C:

http://www.w3.org/TR/WCAG10-HTML-TECHS/#meta-element

Solution 5 - Http

The "Refresh" HTTP response header has been standardized (for web browsers, anyway) in HTML:

https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigating-across-documents%3Ashared-declarative-refresh-steps

That URL doesn't look so stable, so here are the relevant steps as of 2019-12-03:

> 13. If response has a Refresh header, then: > 1. Let value be the isomorphic decoding of the value of the header. > 2. Run the shared declarative refresh steps with document and value.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionelifinerView Question on Stackoverflow
Solution 1 - HttpAlistairView Answer on Stackoverflow
Solution 2 - HttpLokiView Answer on Stackoverflow
Solution 3 - HttpGregView Answer on Stackoverflow
Solution 4 - HttpAlnitakView Answer on Stackoverflow
Solution 5 - HttpMikeView Answer on Stackoverflow