Flagsmith / Flagsmith/edge-proxy-rs

CORS responses differ from the Python proxy

Open
#21 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2
Forks
1
Avg merge
4h 20m
Merged PRs (30d)
1

Description

## Current behaviour

The router uses a hardcoded `CorsLayer::permissive()` (`src/routes/mod.rs`), which differs from the Python proxy in two ways:

1. **Not configurable.** The Python proxy exposes `allow_origins` in settings and runs with `allow_credentials=True`; the Rust proxy always answers `access-control-allow-origin: *` with no credentials support, and there is no setting to narrow origins.

2. **Duplicate `Vary` header lines.** Each tower-http layer appends its own line, so every response carries:

```
vary: accept-encoding
vary: origin, access-control-request-method, access-control-request-headers
```

Starlette merges these into a single `Vary` line. The two forms are semantically identical per RFC 9110, but intermediaries that only read the first line mishandle it — and the CORS line is noise anyway while the origin is a wildcard (the response does not vary by origin).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/routes/mod.rs by reading the existing CorsLayer::permissive() setup and tracing how router settings are configured. Compare the Rust response behavior with the Python proxy details in the issue; done means configurable origins and credentials match the proxy, and the response no longer exposes the problematic duplicate or unnecessary Vary behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.