On Aug 14th 11 PM ET/Aug 15th 03:00 UTC, due to scheduled Firefox Account server maintenance, users may not be able to sign in or create a new subscription. This is expected to last approximately 30 minutes. Status updates can be found at https://status.vpn.mozilla.org or https://status.relay.firefox.com.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Application's javascript is not able to read any of the headers in a HEAD request

  • 4 பதிலளிப்புகள்
  • 1 இந்த பிரச்சனை உள்ளது
  • 2 views
  • Last reply by mbucknell

The response is sending the Access-Control-Expose-Headers as a comma separated list. For example:

Access-Control-Expose-Headers:"Total-Site-Count, BIODATA-Site-Count, NWIS-Site-Count, STEWARDS-Site-Count, STORET-Site-Count, Total-Result-Count, BIODATA-Result-Count, NWIS-Result-Count, STEWARDS-Result-Count, STORET-Result-Count, Warning, FATAL ERROR"

is in the response headers as our the headers themselves.

However, none of them are getting returned when executing getResponseAllHeaders or using getResponseHeader(xxx).

The response is sending the Access-Control-Expose-Headers as a comma separated list. For example: Access-Control-Expose-Headers:"Total-Site-Count, BIODATA-Site-Count, NWIS-Site-Count, STEWARDS-Site-Count, STORET-Site-Count, Total-Result-Count, BIODATA-Result-Count, NWIS-Result-Count, STEWARDS-Result-Count, STORET-Result-Count, Warning, FATAL ERROR" is in the response headers as our the headers themselves. However, none of them are getting returned when executing getResponseAllHeaders or using getResponseHeader(xxx).

தீர்வு தேர்ந்தெடுக்கப்பட்டது

I figured out what the issue was. One of the headers was "FATAL ERROR". That space seems to be what caused the issue. When I changed the server to set the header to 'FATAL-ERROR', firefox worked perfectly

Read this answer in context 👍 0

All Replies (4)

The examples on MDN do include using getResponseHeader so on that basis, I think it should work:

https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Get_last_modified_date

Do you have a page online demonstrating this problem?

The application that I'm testing is not out in the wild because its not working. I'll have to think about how to get a test implementation online. In the meantime, I have attached the network page of the debug tool, showing the response and request headers.

As further information, the application is working in IE11, latest Chrome, and the latest Safari.

Thank you for your time.

Some more additional information. If the list of Allow-Control-Expose-Headers are sent separately, ie one for each custom header we want to be able to read, Firefox works. Of course then IE11, doesn't. It seems like the standard says they should be specified as a comma separated list.

தீர்வு தேர்ந்தெடுக்கப்பட்டது

I figured out what the issue was. One of the headers was "FATAL ERROR". That space seems to be what caused the issue. When I changed the server to set the header to 'FATAL-ERROR', firefox worked perfectly