diff --git a/app.js b/app.js index df89078..1bc1a4e 100644 --- a/app.js +++ b/app.js @@ -13,7 +13,7 @@ app.use(async (ctx, next) => { ctx.set("Access-Control-Allow-Methods", "OPTIONS, GET, PUT, POST, DELETE"); // 字段是必需的。它也是一个逗号分隔的字符串,表明服务器支持的所有头信息字段. - ctx.set("Access-Control-Allow-Headers", "x-requested-with, accept, origin, content-type, referer"); + ctx.set("Access-Control-Allow-Headers", "x-requested-with, accept, origin, content-type, referer, user-agent"); // 服务器收到请求以后,检查了Origin、Access-Control-Request-Method和Access-Control-Request-Headers字段以后,确认允许跨源请求,就可以做出回应。 // Content-Type表示具体请求中的媒体类型信息