Handle OPTIONS request for the /fsbrowser to allow VSC API (Issue
@@ -134,6 +134,14 @@ http {
}
location /fsbrowser/ {
+ if ($request_method = OPTIONS ) {
+ add_header Content-Length 0;
+ add_header Content-Type text/plain;
+ add_header Access-Control-Allow-Headers *;
+ add_header Access-Control-Allow-Origin ${CP_EDGE_FSBROWSER_CORS};
+ add_header Vary Origin;
+ return 200;
+ }
if ($request_uri ~ '^(\/fsbrowser\/(\d+)$)') {
return 301 $1/;
}
@@ -145,6 +153,7 @@ http {
access_by_lua_file /etc/nginx/validate_cookie_fsbrowser.lua;
add_header Access-Control-Allow-Origin ${CP_EDGE_FSBROWSER_CORS};
add_header Vary Origin;
+ add_header Access-Control-Allow-Headers *;
proxy_set_header Authorization $fsbrowser_auth;
proxy_pass http://$fsbrowser_target:${CP_PREF_STORAGE_FSBROWSER_PORT}$fsbrowser_req_uri;
}
