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

CORS issue on API endpoint. #118

Closed
lockness-Ko opened this issue May 2, 2024 · 3 comments
Closed

CORS issue on API endpoint. #118

lockness-Ko opened this issue May 2, 2024 · 3 comments
Assignees
Labels
bug Something isn't working fix self-hosted

Comments

@lockness-Ko
Copy link

Describe the bug
API does not support the OPTIONS method which Chrome uses for CORS hints and the API does not send CORS headers which prevents Chrome from requesting the resource.

To Reproduce
Steps to reproduce the behavior:

  1. Login to tracecat.
  2. Navigate to /workflows.
  3. Check console.

Expected behavior
Requests to the API from the browser are successful.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 123.0.6312.124

Additional context
Problem fixed by putting nginx with this config infront of the API:

location / {
        if ($request_method = OPTIONS ) {
                add_header Access-Control-Allow-Origin * always;
                add_header "Access-Control-Allow-Methods" "DELETE, POST, GET, OPTIONS";
                add_header "Access-Control-Allow-Headers" "Content-Type, Authorization";
                return 200;
        }
        add_header Access-Control-Allow-Origin * always;
        add_header "Access-Control-Allow-Methods" "DELETE, POST, GET, OPTIONS";
        add_header "Access-Control-Allow-Headers" "Content-Type, Authorization";
        proxy_pass http://localhost:8008/;
}
@topher-lo
Copy link
Contributor

@lockness-Ko this is gold. Will add the fix today.

@topher-lo
Copy link
Contributor

@lockness-Ko Turns out this is a RabbitMQ CORS issue...we are removing it in the beta version (i.e. temporal rewrite).

Will close as it as scheduled for removal next week.

@topher-lo
Copy link
Contributor

@daryllimyt gg rabbitmq

@topher-lo topher-lo closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix self-hosted
Projects
None yet
Development

No branches or pull requests

2 participants