Skip to content

Commit 6acfc62

Browse files
authored
fix(server): cors plugin not work with wildcard origin (#121)
1 parent 3478ec1 commit 6acfc62

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/server/src/plugins/cors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class CORSPlugin<TContext extends Context> implements Plugin<TContext> {
7979

8080
const allowedOriginArr = Array.isArray(allowedOrigin) ? allowedOrigin : [allowedOrigin]
8181

82-
if (allowedOriginArr.includes(origin)) {
82+
if (allowedOriginArr.includes(origin) || allowedOriginArr.includes('*')) {
8383
result.response.headers['access-control-allow-origin'] = origin
8484
}
8585

0 commit comments

Comments
 (0)