Jelajahi Sumber

test options

maguohua1 6 tahun lalu
induk
melakukan
d1e231ff7c
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      app.js

+ 1 - 1
app.js

@@ -17,7 +17,7 @@ const app = express();
 app.all('*', (req, res, next) => {
 	res.header("Access-Control-Allow-Origin", req.headers.origin || req.headers.referer || '*');
 	res.header("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With");
-	res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE");
+	res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
   res.header("Access-Control-Allow-Credentials", true); //可以带cookies
 	res.header("X-Powered-By", 'Express');
   next();