Используя S3 MultipartUpload, мне нужен заголовок ETag из запроса AngularJS $http.put. Однако я, кажется, не могу прочитать значение. Любая помощь приветствуется. Спасибо!
$http({
method: 'PUT',
url: url,
headers: {
'Content-Type': filetype,
'Access-Control-Expose-Headers': 'ETag'
},
data: part
})
.then(function(response) {
let test1 = response.headers("ETag");
let test2 = response.headers();
console.info(test1, test2); // ---> null {content-length: '0'}
})
.catch(function(error) {
console.info(error);
});
Выяснилось, что вам нужно обновить CORS корзины S3:
"ExposeHeaders": [
"ETag",
"x-amz-meta-custom-header"
]