Skip to content

fix: allow cross-origin patch requests - #20

Merged
lyz52789 merged 1 commit into
mainfrom
agent/fix-default-actor-rename
Jul 13, 2026
Merged

fix: allow cross-origin patch requests#20
lyz52789 merged 1 commit into
mainfrom
agent/fix-default-actor-rename

Conversation

@lyz52789

Copy link
Copy Markdown

Summary

  • allow cross-origin PATCH requests in the gateway CORS middleware
  • restore browser-based Seedance actor and asset rename calls between www.token123.co and api.token123.co
  • add a regression test for the actor rename preflight response

Root cause

The frontend uses PATCH for actor rename, but the API CORS middleware did not include PATCH in Access-Control-Allow-Methods. Browsers stopped the request at the preflight stage, before the actor controller or database update ran.

Test plan

  • go test ./middleware -count=1
  • go test ./... -count=1
  • production preflight smoke test after deployment

Include PATCH in the CORS preflight response so browser clients can rename Seedance actors and assets across www.token123.co and api.token123.co. Add a regression test for the actor rename preflight.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying new-api with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0d4bb4a
Status: ✅  Deploy successful!
Preview URL: https://76256044.new-api-d57.pages.dev
Branch Preview URL: https://agent-fix-default-actor-rena.new-api-d57.pages.dev

View logs

@lyz52789
lyz52789 merged commit 5212326 into main Jul 13, 2026
2 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