Skip to content

Commit

Permalink
fix: always set cors headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 committed Dec 5, 2023
1 parent 2da1290 commit 9badd28
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ export const createApp = (
)

app.use((req, res, next) => {
res.set('Access-Control-Allow-Origin', '*')
res.set('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
res.set(
'Access-Control-Allow-Headers',
'Content-Type, Authorization, swarm-postage-batch-id, swarm-deferred-upload',
)
if (req.method === 'OPTIONS') {

Check failure on line 51 in src/server.ts

View workflow job for this annotation

GitHub Actions / check (14.x)

Expected blank line before this statement
res.set('Access-Control-Allow-Origin', '*')
res.set('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
res.set(
'Access-Control-Allow-Headers',
'Content-Type, Authorization, swarm-postage-batch-id, swarm-deferred-upload',
)
res.sendStatus(200)
return

Check failure on line 53 in src/server.ts

View workflow job for this annotation

GitHub Actions / check (14.x)

Expected blank line before this statement
}
Expand Down

0 comments on commit 9badd28

Please sign in to comment.