Skip to content

Keep mixed listener CORS policy authoritative - #11

Merged
Ri-go merged 1 commit into
masterfrom
id-1610-stitch-cors
Sep 18, 2026
Merged

Ri-go merged 1 commit into
masterfrom
id-1610-stitch-cors

Conversation

@Ri-go

@Ri-go Ri-go commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

The mixed gRPC-Web listener now keeps its configured CORS policy when REST or gRPC backends send conflicting headers. Responses return one allowed origin, discard upstream CORS permissions, and preserve streaming, trailers and unrelated headers.

Validated with the full test suite, vet, lint and focused race tests. New regressions cover REST, native gRPC over h2c, binary/text gRPC-Web, denied origins and streamed responses.

Summary by CodeRabbit

  • Bug Fixes
    • Enforced configured cross-origin access policies consistently across REST, native gRPC, and gRPC-Web requests.
    • Blocked requests from disallowed origins before they reach backend services.
    • Prevented upstream responses from overriding configured CORS policies.
    • Preserved non-CORS headers, streaming responses, trailers, and error handling while applying CORS rules.
    • Improved handling of wildcard origins, missing origins, and late response header updates.

@linear

linear Bot commented Sep 18, 2026

Copy link
Copy Markdown

ID-1610

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: ac6592a6-bff1-4b45-bfd5-e353e37caafd

📥 Commits

Reviewing files that changed from the base of the PR and between 7ce8d4e and f2f3ddd.

📒 Files selected for processing (4)
  • internal/server/cosmos_grpc/web.go
  • internal/server/cosmos_grpc/web_cors.go
  • internal/server/cosmos_grpc/web_cors_test.go
  • internal/server/cosmos_grpc/web_test.go
 ____________________________________________________________
< To iterate is human, to recurse divine. - L. Peter Deutsch >
 ------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@Ri-go
Ri-go merged commit 46d50f3 into master Sep 18, 2026
8 of 9 checks passed
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

Successfully merging this pull request may close these issues.

1 participant