-
Notifications
You must be signed in to change notification settings - Fork 32
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
Error 403 "CORS not enabled for bucket" when making OPTIONS request to manifest #436
Comments
I'm just working on this. I can get it working if you specify the following request header:
Is that a problem for you @jbaiter? |
I think that would add an additional requirement on clients, and that would be more difficult to support across servers. I have a common snippet of nginx configuration that I add to all IIIF servers now:
This allows most servers to support OPTIONS requests without any additional requirements for clients to include in their request headers.
|
Does it matter that the content type is wrong in your example? (text/plain rather than json)? For info the way I've got it working at the moment its S3 thats throwing a 403 error without the method being specified:
I'm configuring it using: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManageCorsUsing.html#cors-allowed-methods which requires you to sepcify the allowed methods. Pull request: |
OK I think I've fixed it so it doesn't require the request method. Its deploying now. |
The OPTIONS responses are empty, so it should send an empty body (Content-Length 0) and a 204 No Content response. In that case, it doesn't really matter what the Content-Type is. |
Thanks Andrew. I've got it working like this:
Let me know if there are any other issues. |
Request:
Response:
Given how important CORS is for IIIF, it would probably be wise to properly enable/implement it for cookbook resources and not only set the
Access-Control-Allow-Origin
header to*
.Background:
This error happens when making Content-Negotiation aware GET requests to resources, i.e. with an
Accept
header value that specifies the full JSON-LD MIME types for IIIF (see https://github.com/ProjectMirador/mirador/pull/3770/files#diff-166256fe28a89c78ada7b08488a3233671fc0511fd39d323c5cfc9433026e2a1R108-R112). These requests trigger a preflight OPTIONS request due to certain characters in theAccept
header (more gnarly details in this comment: ProjectMirador/mirador#3770 (comment)).The text was updated successfully, but these errors were encountered: