Cross-Origin Resource Sharing (CORS) affecting the development of OCL

Got it.

It’s important to follow up on this kind of thing, so we can actually action on it. None of us really understand CORS in detail, and we do not understand your app, so we need some feedback so we can actually do something about it.

This is what ended up working:

location / {
        if ($request_method = 'OPTIONS') {
          add_header 'Access-Control-Allow-Origin' '*';
          add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS, POST';
          add_header 'Access-Control-Allow-Headers' 'authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
          #
          # Tell client that this pre-flight info is valid for 20 days
          #
          add_header 'Access-Control-Max-Age' 1728000;
          add_header 'Content-Type' 'text/plain; charset=utf-8';
          add_header 'Content-Length' 0;
          return 204;
        }
        if ($request_method = 'POST') {
          add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS, POST';
          add_header 'Access-Control-Allow-Headers' 'authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
          add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
        }
        if ($request_method = 'GET') {
          add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS, POST';
          add_header 'Access-Control-Allow-Headers' 'authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
          add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
        }
        proxy_pass http://127.0.0.1:8000/;
      }

Also, just to let you know.

I suppose because I didn’t create anything in OCL, there’s a bunch of 500 errors after I login:

Those URLs look pretty weird.