Skip to content

Commit

Permalink
知道问题了. 返回的308 redirect, 上面没有cors header. chrome就卡在这里了 (按说 redirect默认是…
Browse files Browse the repository at this point in the history
…follow), 说没有cors. 但是postman没有问题. 加vercel.json试试
  • Loading branch information
boyangwang committed Jul 12, 2023
1 parent db1272b commit 2c65ba4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"headers": [
{
"source": "/api/(.*)",
"headers": [
{ "key": "Access-Control-Allow-Credentials", "value": "true" },
{ "key": "Access-Control-Allow-Origin", "value": "*" },
{ "key": "Access-Control-Allow-Methods", "value": "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
{ "key": "Access-Control-Allow-Headers", "value": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }
]
}
]
}

0 comments on commit 2c65ba4

Please sign in to comment.