W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] Access the Response Headers for the Current Document

From: Joseph Pecoraro <joepeck02@gmail.com>
Date: Wed, 15 Jul 2009 15:07:05 -0400
Message-ID: <78D4ADCC-F115-4523-9495-A73BB1C47F40@gmail.com>
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].

Use Cases:
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.

Come up with a clear description of the problem that needs to be solved:
Cannot access the Response Headers for the current document in  
Javascript.

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:

   document.getAllResponseHeaders() and  
document.getResponseHeader(header)

Cheers,
Joseph Pecoraro

[1] Example: http://bogojoker.com/x/xhr/headers.html
Received on Wednesday, 15 July 2009 12:07:05 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC