Pārlūkot izejas kodu

调整 preflight 逻辑

zjcqoo 6 gadi atpakaļ
vecāks
revīzija
6bed122266
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      api.conf

+ 2 - 2
api.conf

@@ -15,7 +15,7 @@ location = /preflight {
   internal;
   more_set_headers
     'access-control-allow-origin: *'
-    'access-control-allow-methods: GET,POST,PUT,DELETE,HEAD,OPTIONS'
+    'access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS'
     'access-control-allow-headers: --url,--referer,--cookie,--origin,--ext,--aceh,--ver,accept,accept-charset,accept-encoding,accept-language,accept-datetime,authorization,cache-control,content-length,content-type,date,if-match,if-modified-since,if-none-match,if-range,if-unmodified-since,max-forwards,pragma,range,te,upgrade,upgrade-insecure-requests,x-requested-with,chrome-proxy'
     'access-control-max-age: 1728000'
   ;
@@ -25,7 +25,7 @@ location = /preflight {
 
 # HTTP(S) Proxy
 location = /http {
-  if ($request_method = 'OPTIONS') {
+  if ($http_access_control_request_headers) {
     rewrite           ^   /preflight;
   }