Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/middleware/builtin/cors.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ If you want to adjust CORS configuration according to the execution environment,
```ts
app.use('*', async (c, next) => {
const corsMiddlewareHandler = cors({
origin: c.env.CORS_ORIGIN,
origin: [c.env.CORS_ORIGIN],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the origin option can accept a string. So this change is unnecessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on whether the CORS_ORIGIN is a string or string[]. But I think this change is unnecessary.

})
return corsMiddlewareHandler(c, next)
})
Expand Down