findify / s3mock

Embedded S3 server for easy mocking
MIT License
388 stars 107 forks source link

CORS requests are not supported #133

Open phihag opened 6 years ago

phihag commented 6 years ago

To upload on S3 from a website, one needs to have CORS, namely the preflight request. This is enabled on S3 and most other local S3 emulations by default, but not available with s3mock:

$ docker run -p 8001:8001 -d findify/s3mock:latest
$ curl -i 'http://localhost:8001/mybucket' -X OPTIONS -H 'Access-Control-Request-Method: POST' -H 'Origin: https://meine.local.tonie.cloud'
HTTP/1.1 501 Not Implemented
Server: akka-http/10.0.10
Date: Mon, 10 Sep 2018 13:31:10 GMT
Content-Length: 0