René's URL Explorer Experiment


Title: fix(security): remove localhost CORS origin, consolidate CORS in proxy by waleedlatif1 · Pull Request #4658 · simstudioai/sim · GitHub

Open Graph Title: fix(security): remove localhost CORS origin, consolidate CORS in proxy by waleedlatif1 · Pull Request #4658 · simstudioai/sim

X Title: fix(security): remove localhost CORS origin, consolidate CORS in proxy by waleedlatif1 · Pull Request #4658 · simstudioai/sim

Description: Summary Move all /api/* CORS handling from next.config.ts to proxy.ts so allowed origin is resolved per-request at runtime instead of baked at build time (which produced Access-Control-Allow-Origin: http://localhost:3000 with credentials: true in production) Per-route policy table in proxy covers auth, MCP, form, and workflow execute endpoints; OPTIONS preflight short-circuited uniformly Drop NEXT_PUBLIC_APP_URL build placeholder from Dockerfile (Zod has skipValidation: true; build path doesn't read it) Remove 8 dead route OPTIONS handlers and their preflight tests now that the proxy handles preflight Type of Change Bug fix Testing Tested manually Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Move all /api/* CORS handling from next.config.ts to proxy.ts so allowed origin is resolved per-request at runtime instead of baked at build time (which produced Access-Control-Allow-Origi...

X Description: Summary Move all /api/* CORS handling from next.config.ts to proxy.ts so allowed origin is resolved per-request at runtime instead of baked at build time (which produced Access-Control-Allow-Origi...

Opengraph URL: https://github.com/simstudioai/sim/pull/4658

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b056172c-ea5b-1999-bf84-adf5f34e42ea
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id92C4:15DF38:ED516B:142E40A:6AFB5E4F
html-safe-nonceb9be8cbee02d299b448ac1db527196d4693cabeb486f35d034a6abe23d3c7886
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkM0OjE1REYzODpFRDUxNkI6MTQyRTQwQTo2QUZCNUU0RiIsInZpc2l0b3JfaWQiOiIyMTUxNzA0NTQ1MDU4NzI5NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac691b532b14a56ca574e2005065e48d7c2fd9a8245db1c26c439694e308f34afa
hovercard-subject-tagpull_request:3705949430
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/4658/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Move all /api/* CORS handling from next.config.ts to proxy.ts so allowed origin is resolved per-request at runtime instead of baked at build time (which produced Access-Control-Allow-Origi...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/4658/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4658%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4658%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/4658/files
Reloadhttps://github.com/simstudioai/sim/pull/4658/files
Reloadhttps://github.com/simstudioai/sim/pull/4658/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
waleedlatif1/csp-localhost-reviewhttps://github.com/simstudioai/sim/tree/waleedlatif1/csp-localhost-review
Conversation 23 https://github.com/simstudioai/sim/pull/4658
Commits 6 https://github.com/simstudioai/sim/pull/4658/commits
Checks 13 https://github.com/simstudioai/sim/pull/4658/checks
Files changed https://github.com/simstudioai/sim/pull/4658/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4658/files
fix(security): remove localhost CORS origin, consolidate CORS in proxy https://github.com/simstudioai/sim/pull/4658/files#top
Show all changes 6 commits https://github.com/simstudioai/sim/pull/4658/files
e168fab fix(security): remove localhost CORS origin, consolidate CORS in proxy waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4658/commits/e168fab8ed930d4e1e325629b57a57ff555d3075
ae03108 refactor(cors): consolidate API CORS into proxy as single source of t… waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4658/commits/ae031087bc9343832f0cf6e7eaf15a112c85df22
b2956f1 refactor(cors): convert proxy CORS policy chain to a rule table + add… waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4658/commits/b2956f1fae5b13f8646940c15c5420826887af5e
99bb0f9 fix(cors): scope embed CORS rule to /api/{chat,form}/[identifier] only waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4658/commits/99bb0f9ae4ba4a019b18ec1b880987db4793cb71
80aa102 refactor(cors): replace embed-path regex with explicit segment check waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4658/commits/80aa1026a731f2aaf4cfae02f9e4e8c0c268d1d5
5968f3b fix(cors): allow PUT in embed CORS policy for OTP verification waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4658/commits/5968f3b45e9c992a7dc4f40318ea4c3832a2c1f0
Clear filters https://github.com/simstudioai/sim/pull/4658/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4658/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4658/files
route.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
route.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-5a523744ef25f2853c9f48b13e2dd49b2bbe8e8b5d6bef11e23e1222c5d81205
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-8a99c670b366e7334e33efd903879be80c26cf0335260ab6be13877cc8934303
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-40b7a948030c3f46cd47e257dc61435bb0deba461be508aeb5731e13f407dac3
utils.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-49d950d7ed200838e60fdcd84f0ae3b6a7e06d69830ba01f128b33857406cbd7
route.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-0aeb4068b7758d4ef1411371426ad6fc010051f1f9afc5abecf9b2987f37702d
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-5594eb05157ba8b2972f052e6f0feca5014f8ce4a9e74a471935347b0cd45194
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-d297e4f6a0aeab1c990637cc6c528ddf020d161fe62222fa727b53df0bb0bb5c
route.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-9a380a36165a2c6c2d46586d280bf22d896cc481033d062503c9db60ce0db1e3
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-8afbc69ee8a248a0b4f51fb065b51a2d1004ae80cf2d93578a2d2a6bab5923e4
route.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-06d9cc518713cb1b4e4d1b0e6c1a8fed2f1c8e05d91ca372b4913e2d14ada1bf
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-ce9d09ae154528087734e3e471bff2f2e1615d7924140fb91813b745e68e5f2c
utils.ts https://github.com/simstudioai/sim/pull/4658/files#diff-cf0dbd7a02f4ac25fd4c864b014708c1d978d75efe972fae5ffcb021be58a9d3
route.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-45a8c5aee9a31e6a3052271a939826761ef626138cada2f4003fa67d5ca83ad6
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-2a74d2840671adc54823e635e962c3abed825ebada665629856997e1f2de90ea
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-962bd3853844429bedede492e7bebd1edce70f6d0ef9ce6dfef51ef02baeebea
utils.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-a23789193b4fafc6235ea44175e087730e9d3e974d6dc90432339cbe175f5c63
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-5b7748e8b2e0e1a3294a7478e3a854a0ea73cdf70ee0826ec8caf3f9b959f608
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-448d6a157f0d738e9c4777a7ed3d8d764c0450f70ac381cac7e061aa01408fe5
route.ts https://github.com/simstudioai/sim/pull/4658/files#diff-57300207a93ce147f53a4d9517d4c5999e3ea3d37d18aa6f0a07a0acc844d8cc
deployment.ts https://github.com/simstudioai/sim/pull/4658/files#diff-1634e62e54b822c14517ea3de8e24b01616e7048cb0509d47e99a69d09e98dcf
next.config.ts https://github.com/simstudioai/sim/pull/4658/files#diff-a2e0d564b8bf660a492f7abe431643db390b0f5696809465afc46475f552f15f
proxy.test.ts https://github.com/simstudioai/sim/pull/4658/files#diff-85921dbeaec3aa778a756f3c9366a482c82f303630a95dd650ab91c5f446b8e3
proxy.ts https://github.com/simstudioai/sim/pull/4658/files#diff-15ec1afb2cdc5fde188dc70ae860a2f0ec3970fab290ca04263b685b5dd2cff3
app.Dockerfile https://github.com/simstudioai/sim/pull/4658/files#diff-c77b184581d79618e626c89460b0899fbdd892d86049e0aa634c8b1c3b4cab8d
apps/sim/app/api/chat/[identifier]/otp/route.test.tshttps://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
View file https://github.com/simstudioai/sim/blob/5968f3b45e9c992a7dc4f40318ea4c3832a2c1f0/apps/sim/app/api/chat/%5Bidentifier%5D/otp/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4658/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
https://github.com/simstudioai/sim/pull/4658/files#diff-426f0cc11fcb02d3b9ab0d35eaa6decce992f6cd5242e6d19a74df4a2029cf79
apps/sim/app/api/chat/[identifier]/otp/route.tshttps://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
View file https://github.com/simstudioai/sim/blob/5968f3b45e9c992a7dc4f40318ea4c3832a2c1f0/apps/sim/app/api/chat/%5Bidentifier%5D/otp/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4658/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
https://github.com/simstudioai/sim/pull/4658/files#diff-a13d9967f4a5ea9e418cd26f50714ea88964dd7a294e6781327e9a57fc4a5c36
apps/sim/app/api/chat/[identifier]/route.test.tshttps://github.com/simstudioai/sim/pull/4658/files#diff-5a523744ef25f2853c9f48b13e2dd49b2bbe8e8b5d6bef11e23e1222c5d81205
View file https://github.com/simstudioai/sim/blob/5968f3b45e9c992a7dc4f40318ea4c3832a2c1f0/apps/sim/app/api/chat/%5Bidentifier%5D/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4658/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4658/files#diff-5a523744ef25f2853c9f48b13e2dd49b2bbe8e8b5d6bef11e23e1222c5d81205
https://github.com/simstudioai/sim/pull/4658/files#diff-5a523744ef25f2853c9f48b13e2dd49b2bbe8e8b5d6bef11e23e1222c5d81205
https://github.com/simstudioai/sim/pull/4658/files#diff-5a523744ef25f2853c9f48b13e2dd49b2bbe8e8b5d6bef11e23e1222c5d81205
https://github.com/simstudioai/sim/pull/4658/files#diff-5a523744ef25f2853c9f48b13e2dd49b2bbe8e8b5d6bef11e23e1222c5d81205
https://github.com/simstudioai/sim/pull/4658/files#diff-5a523744ef25f2853c9f48b13e2dd49b2bbe8e8b5d6bef11e23e1222c5d81205
Please reload this pagehttps://github.com/simstudioai/sim/pull/4658/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4658/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.