tracecat
tracecat copied to clipboard
CORS issue on API endpoint.
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:
- Login to tracecat.
- Navigate to /workflows.
- Check console.
Expected behavior Requests to the API from the browser are successful.
Screenshots
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/;
}