'AWS S3: PUT requests only succeed if bucket CORS config contains AllowedOrigins: "*"
I have a bucket in S3 to which I wish to PUT some data using JavaScript running on "http://cats.com".
To ensure only requests from "cats.com" can make PUT requests, I set the following as the CORS config in S3:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"http://cats.com/"
],
"ExposeHeaders": []
}
]
Requests did not succeed. But if I set:
"AllowedOrigins": [
"*"
],
PUT requests worked.
Could there be some kind of proxy or other networking service that is somehow changing the origin of the requests? Any pointers others can offer would be greatly appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
