Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

IE limit of 255 chars on Refresh header?

Back to Forum: Tech Off
  • User profile image

    It is a common practice in the web development world to create auto-redirecting pages by using one of these two techniques:

    1) Use an HTTP "Refresh" header
    Refresh: $seconds; url="$url"

    2) Use a <meta> tag to approximate the "Refresh" header
    <meta http-equiv="Refresh" content="$seconds; url=&quot;$url&quot;">

    where $seconds is a numeric delay between page load and redirect, and $url is the redirection target (the '; url="$url"' bit is optional)

    However the first method fails in IE if the length of the "value" part of the Refresh: header is > 255.  For the precise format above, this translates (for single-digit seconds) to url length > 246.

    The second method works for much longer URLs.

    See the HTTP Refresh test page I threw together:

    I have verified via HTTP sniffing that the web server software is correctly adding the header... in fact, the long URLs work correctly in Firefox.

    Caveat: The "Refresh" header is non-standard.

  • User profile image

    Eric Law of the Internet Explorer team will file a bug
    (see comment timestamped Thursday, January 19, 2006 1:36 PM)

  • User profile image

    You can just use JavaScript I guess for the time being...

  • User profile image

    Or even better, use a shorter URL (generated by TinyURL, or a homebrew one on your server). Is there any reason for having an URL that long?

  • User profile image

    My current workaround is to check whether the URL is longer than 246 characters, AND the browser is IE - if both are true I add the <meta> tag.  I add the HTTP header regardless.

    As to why... the application in question is a job site.  Clients want applications referred to URLs of their choosing... sometimes the URLs they give us are longer than 255 characters.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.