Skip to content
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

Default CORs settings (allow-origin: * & allow-credentials: true) Breaks Ajax #65

Open
krismeister opened this issue Mar 4, 2020 · 0 comments

Comments

@krismeister
Copy link

krismeister commented Mar 4, 2020

  • Expected behaviour:
    By default OPTION show not have access-control-allow-credentials: "true" set by default.

  • What actually happens:
    The default behavior of an endpoint in claudia rest has wildcard and allow-credentials true.

HTTP/2.0 200 OK
content-type: application/json
content-length: 0
date: Wed, 04 Mar 2020 18:11:26 GMT
x-amzn-requestid: 30853b72-2dc9-4734-9bcf-034dcfc63a6d
access-control-allow-origin: *         <<<< ISSUE
access-control-allow-headers: Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token
x-amz-apigw-id: I4JUTGEUoAMF8YA=
access-control-allow-methods: OPTIONS,GET,POST
access-control-allow-credentials: true       <<<< ISSUE
x-cache: Miss from cloudfront
.....

This combination of current default options:

access-control-allow-credentials: "true"
and
access-control-allow-origin: *  

Throws a security issue in ALL browsers during a cross domain AJAX request. To obey the security model, if access-control-allow-credentials: "true" then the access control must be a full origin access-control-allow-origin: https://test.com:5050

  • Steps to reproduce the problem:

Start a new project with one end point, load it via ajax from a different domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant