HumanSignal / HumanSignal/label-studio

URL scheme must be "http" or "https" for CORS request.

Open
#7,406 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**
When attempting to make a GET request to the /api/users/ endpoint using curl, the request fails with the following message:

Failed to fetch.
Possible Reasons:

CORS
Network Failure
URL scheme must be "http" or "https" for CORS request.

**To Reproduce**
Steps to reproduce the behavior:
1. Deploy Label Studio behind a load balancer or proxy (e.g. ALB/Nginx).
2. Send a curl request like:
curl -X 'GET' \
'https://domain/api/users/' \
-H 'accept: application/json' \
-H 'X-CSRFTOKEN: [my_token_here]'
5. Observe the failed response: Failed to fetch.
6.
**Expected behavior**
The API should return a JSON response with the list of users (assuming authentication is valid), without CORS/network errors.

**Screenshots**

![Image](https://github.com/user-attachments/assets/964609e1-2f4a-47e7-982f-510bc4ab3a5e)

**Environment (please complete the following information):**
- OS: [Docker]
- Label Studio Version [1.15.0]
- Deployment: AWS ECS (EC2), behind ALB

**Additional context**
ECS task has the following environment variables set:

SECURE_SSL_REDIRECT=true

SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https

CSRF_TRUSTED_ORIGINS=https://my.domain

Issue may be related to Django not recognizing forwarded HTTPS headers from proxy.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.