File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " openworkers-api" ,
3- "version" : " 1.3.3 " ,
3+ "version" : " 1.3.4 " ,
44 "license" : " MIT" ,
55 "module" : " src/index.ts" ,
66 "type" : " module" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import { Hono } from 'hono';
1212 * for browser-based requests (WebContainers).
1313 */
1414
15- const ALLOWED_HOSTS = [ 'api.anthropic.com' , 'console.anthropic.com' ] ;
15+ // Allow all Anthropic subdomains
16+ const ALLOWED_HOST_PATTERN = / ^ ( .+ \. ) ? a n t h r o p i c \. c o m $ / ;
1617
1718// Allowed origins for CORS (dashboard domains + WebContainers)
1819const ALLOWED_ORIGINS = [
@@ -56,8 +57,8 @@ corsProxy.all('/*', async (c) => {
5657
5758 console . log ( `[cors-proxy] ${ c . req . method } ${ targetPath } -> ${ targetHost } ` ) ;
5859
59- // Validate target host
60- if ( ! ALLOWED_HOSTS . includes ( targetHost ) ) {
60+ // Validate target host (must be *.anthropic.com)
61+ if ( ! ALLOWED_HOST_PATTERN . test ( targetHost ) ) {
6162 return c . json ( { error : 'Host not allowed' } , 403 ) ;
6263 }
6364
You can’t perform that action at this time.
0 commit comments