Selaa lähdekoodia

Merge pull request #13189 from overleaf/jdt-sync-cors-headers

Jdt sync cors headers

GitOrigin-RevId: 0cec2a8f385be327c6abd4c4129500421a6019fd
Jimmy Domagala-Tang 3 vuotta sitten
vanhempi
sitoutus
c165eb80b1
1 muutettua tiedostoa jossa 4 lisäystä ja 8 poistoa
  1. 4 8
      services/clsi/nginx.conf

+ 4 - 8
services/clsi/nginx.conf

@@ -31,18 +31,16 @@ server {
   location ~ ^/project/0([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.pdf$ {
   location ~ ^/project/0([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.pdf$ {
     if ($request_method = 'OPTIONS') {
     if ($request_method = 'OPTIONS') {
       # handle OPTIONS method for CORS requests
       # handle OPTIONS method for CORS requests
-      add_header 'Content-Type' 'text/plain charset=UTF-8';
       add_header 'Allow' 'GET,HEAD';
       add_header 'Allow' 'GET,HEAD';
-      return 200 'GET,HEAD';
+      return 204;
     }
     }
     alias /var/clsi/tiny.pdf;
     alias /var/clsi/tiny.pdf;
   }
   }
   location ~ ^/project/0([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.pdf$ {
   location ~ ^/project/0([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.pdf$ {
     if ($request_method = 'OPTIONS') {
     if ($request_method = 'OPTIONS') {
       # handle OPTIONS method for CORS requests
       # handle OPTIONS method for CORS requests
-      add_header 'Content-Type' 'text/plain charset=UTF-8';
       add_header 'Allow' 'GET,HEAD';
       add_header 'Allow' 'GET,HEAD';
-      return 200 'GET,HEAD';
+      return 204;
     }
     }
     alias /var/clsi/tiny.pdf;
     alias /var/clsi/tiny.pdf;
   }
   }
@@ -69,9 +67,8 @@ server {
   location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
   location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
     if ($request_method = 'OPTIONS') {
     if ($request_method = 'OPTIONS') {
       # handle OPTIONS method for CORS requests
       # handle OPTIONS method for CORS requests
-      add_header 'Content-Type' 'text/plain charset=UTF-8';
       add_header 'Allow' 'GET,HEAD';
       add_header 'Allow' 'GET,HEAD';
-      return 200 'GET,HEAD';
+      return 204;
     }
     }
     alias /output/$1/generated-files/$2/output.$3;
     alias /output/$1/generated-files/$2/output.$3;
   }
   }
@@ -101,9 +98,8 @@ server {
   location ~ ^/project/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
   location ~ ^/project/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
     if ($request_method = 'OPTIONS') {
     if ($request_method = 'OPTIONS') {
       # handle OPTIONS method for CORS requests
       # handle OPTIONS method for CORS requests
-      add_header 'Content-Type' 'text/plain charset=UTF-8';
       add_header 'Allow' 'GET,HEAD';
       add_header 'Allow' 'GET,HEAD';
-      return 200 'GET,HEAD';
+      return 204;
     }
     }
     # Cache for one day
     # Cache for one day
     expires 1d;
     expires 1d;