Is it possible that the usage of HTTP to obtain a document for rendering and to obtain a document for XHR would differ sufficiently that the HTTP headers would differ?<br><br><div class="gmail_quote">On Wed, Jul 15, 2009 at 12:07 PM, Joseph Pecoraro <span dir="ltr"><<a href="mailto:joepeck02@gmail.com">joepeck02@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It seems like an oversight that Javascript can read response headers off of XHR but not for the current document.  So in order to find out the headers for the current document you would need to make another request, refetching the current page, to find that out [1].<br>

<br>
Use Cases:<br>
Any that apply to XHR accessing their response headers would certainly apply here.  Some thoughts are accessing the Content-Type header or Custom Headers and acting accordingly.<br>
<br>
Come up with a clear description of the problem that needs to be solved:<br>
Cannot access the Response Headers for the current document in Javascript.<br>
<br>
Any there Browser Implementors out there that agree with this?  If so, any thoughts on the best ways to expose the current page's request headers to Javascript?  Certainly they are readonly, modifying them seems to be useless.  How about keeping consistent with the XHR interface with something like:<br>

<br>
  document.getAllResponseHeaders() and document.getResponseHeader(header)<br>
<br>
Cheers,<br>
Joseph Pecoraro<br>
<br>
[1] Example: <a href="http://bogojoker.com/x/xhr/headers.html" target="_blank">http://bogojoker.com/x/xhr/headers.html</a><br>
</blockquote></div><br>