I'm trying to read the ETag HTTP header returned by a PUT to AWS S3 but it's not available in the Angular typescript (it is in the browser HTTP response). I have added it to the ExposeHeaders CORS and it is returned in the Access-Control-Expose-Headers header and in the ETag header, but I still can't read it !!!
This is my CORS config:
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [
"ETag"
],
"MaxAgeSeconds": 10
}
]
This is my HTTP response headers:
x-amz-id-2: <blah>
x-amz-request-id: <blah>
Date: Sat, 10 Apr 2021 15:07:04 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, PUT, POST
Access-Control-Expose-Headers: ETag
Access-Control-Max-Age: 10
Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
ETag: "f58<blah>6ae"
x-amz-server-side-encryption: AES256
Content-Length: 0
Server: AmazonS3
And this is my HTTPEvent response (I'm observing events) console log (I get same header details from observing the response btw):
Agular console log of response headers
There are many questions on this topic but I haven't seen any where the HTTP response headers appear to allow the ETag header but it can't be read from Angular anyway.
Many thanks