Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Access ETag Header in Fetch API Response #483

Open
matti606 opened this issue May 21, 2023 · 5 comments
Open

Unable to Access ETag Header in Fetch API Response #483

matti606 opened this issue May 21, 2023 · 5 comments
Labels
Bug Confirmed This behaviour has been reproduced

Comments

@matti606
Copy link

Problem:

Based on the documentation ETag-based caching should be supported. However, I am unable to access the ETag header in the Fetch API response using response.headers.get('ETag'). The ETag header is not visible or accessible through the Headers object.

Details:

  • The ETag header is present in the response according to the network tab in the browser's inspector.
  • Other headers like Cache-Control and Content-Type are accessible.
  • This issue prevents me from utilizing ETag-based caching and cache validation.
@Bertware
Copy link
Member

Could you check if this has been fixed? I added additional CORS headers.

@matti606
Copy link
Author

Sorry, still can't get the Etag. I see in your commit you describe XHR requests, I'm using fetch or does this not work with fetch?

@Bertware
Copy link
Member

XHR/Fetch requests are the same thing. It seems the deploy may have gotten stuck, so you could try again to see if it has been resolved now. Are you perhaps trying to access the liveboard endpoint? I noticed some headers aren't properly populating there.

@Bertware Bertware added Confirmed This behaviour has been reproduced Bug labels Oct 27, 2023
@matti606
Copy link
Author

Hi, thanks for the notice. I have just tested it and it's fixed.

@matti606 matti606 reopened this Oct 27, 2023
@matti606
Copy link
Author

Okay so the headers is only present if there's a 200 response. When checking for a new eTag, the 304 response doesn't have the following headers:

Access-Control-Allow-Headers: *
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed This behaviour has been reproduced
Projects
None yet
Development

No branches or pull requests

2 participants