GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: bypass built-in CORS handling for workspace apps by Emyrk · Pull Request #17596 · coder/coder

Conversation

@Emyrk

@Emyrk Emyrk commented Apr 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Continues #15669

This PR introduces a partial fix for #15096; it allows operators to specify the CORS behavior on a per-coder_app level.

This change requires cors_behavior to be set on a given coder_app; coder/terraform-provider-coder#309 introduces that new attribute.

coderd currently handles CORS automatically by handling preflight requests and stripping CORS headers from upstream coder_app responses.

Two CORS behaviors are defined in this PR:

  • simple: the current behavior of handling CORS within coderd
  • passthru: new behavior which transparently bypasses our CORS handling in coderd so the coder_app service is then fully responsible for handling CORS

We plan to further add this behavior to port shares.

The sharing level (owner, authenticated, public) is still respected, regardless of CORS behavior.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dannykopping and others added 14 commits November 28, 2024 12:04
@dannykopping
Working implementation
0dc7ca3
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Rename CorsBehavior to CORSBehavior
3c0e33a
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Hard & simplify CORORS handling logic
a4d3c8d
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Minor fixes
873c3e4
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Appeasing the linter
65f984f
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Move type def to codersdk
1f0b34c
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Appease the linter, again
5be5477
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Fix migration num
ddbbaa9
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Removing unnecessary header check
63c1852
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Improve tests
976cd78
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping
Merge branch 'main' of https://github.com/coder/coder into dk/cors
9f9068f
@dannykopping
Comprehensive CORS test suite for both request & response
3dc00e1
Signed-off-by: Danny Kopping <[email protected]>
@Emyrk
Merge remote-tracking branch 'origin/main' into stevenmasley/cors
5e1c6eb
@Emyrk
make gen
3266967
@github-actions github-actions Bot assigned Emyrk Apr 28, 2025
@Emyrk
formatting
9065623
@Emyrk Emyrk changed the title Stevenmasley/cors feat: bypass built-in CORS handling for workspace apps Apr 28, 2025
@Emyrk
move cors to after app handling
991d285
@github-actions

github-actions Bot commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

🚀 Deploying PR 17596 ...

github-actions[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Emyrk added 3 commits April 28, 2025 19:47
@Emyrk
gen
5ba7b82
@Emyrk
chore: work on template to test cors
bc8cce3
@Emyrk
chore: add template to test cors behavior
de30a29
@github-actions github-actions Bot added the stale This issue is like stale bread. label May 7, 2025
@f0ssel
f0ssel requested review from cstyan and removed request for cstyan May 8, 2025 14:38
@github-actions github-actions Bot removed the stale This issue is like stale bread. label May 9, 2025
@github-actions github-actions Bot added the stale This issue is like stale bread. label May 16, 2025
@github-actions github-actions Bot closed this May 19, 2025
@Emyrk Emyrk reopened this May 19, 2025
@Emyrk
Emyrk requested a review from spikecurtis as a code owner May 19, 2025 13:48
@Emyrk
Emyrk requested a review from johnstcn as a code owner May 19, 2025 13:48
@Emyrk Emyrk closed this May 19, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2025
@Emyrk

Emyrk commented May 19, 2025

Copy link
Copy Markdown
Member Author

Sorry for the github noise. This is not done, it is still relevant, I just don't have the time to take this over the line.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Emyrk
Emyrk removed request for johnstcn and spikecurtis May 19, 2025 13:48
@Emyrk
Emyrk deleted the stevenmasley/cors branch July 22, 2025 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Emyrk Emyrk

Labels

stale This issue is like stale bread.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Emyrk @dannykopping
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.