GithubHelp home page GithubHelp logo

Comments (6)

bryantgillespie avatar bryantgillespie commented on August 18, 2024 1

I closed it because it looks like you've created a secondary report here and it's been labeled as a bug within the API.
directus/directus#20577

It doesn't seem to be an "AgencyOS" issue per say.

from agency-os.

jbool24 avatar jbool24 commented on August 18, 2024 1

Ok. Thanks. Didn't see that ticket got updated. Thanks, Bryant.

from agency-os.

jbool24 avatar jbool24 commented on August 18, 2024

It looks like the Pre-flight request headers are missing for the Access-Control-Allow-Origin with my configured white-list.

Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type,Authorization
Access-Control-Allow-Methods: GET,POST,PATCH,DELETE
Access-Control-Expose-Headers: Content-Range
Access-Control-Max-Age: 18000
Alt-Svc: h3=":443"; ma=86400
Content-Length: 0
Content-Security-Policy: script-src 'self' 'unsafe-eval';worker-src 'self' blob:;child-src 'self' blob:;img-src 'self' data: blob:;media-src 'self';connect-src 'self' https://*;default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'
Date: Fri, 10 Nov 2023 18:36:40 GMT
Server: cloudflare
Vary: Origin
Via: 1.1 vegur
X-Powered-By: Directus

from agency-os.

daver987 avatar daver987 commented on August 18, 2024

It looks like the Pre-flight request headers are missing for the Access-Control-Allow-Origin with my configured white-list.

Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type,Authorization
Access-Control-Allow-Methods: GET,POST,PATCH,DELETE
Access-Control-Expose-Headers: Content-Range
Access-Control-Max-Age: 18000
Alt-Svc: h3=":443"; ma=86400
Content-Length: 0
Content-Security-Policy: script-src 'self' 'unsafe-eval';worker-src 'self' blob:;child-src 'self' blob:;img-src 'self' data: blob:;media-src 'self';connect-src 'self' https://*;default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'
Date: Fri, 10 Nov 2023 18:36:40 GMT
Server: cloudflare
Vary: Origin
Via: 1.1 vegur
X-Powered-By: Directus

I had similar issues fighting with cors, I went through and changed all the data fetching to be from the server side, no need to fetch from the client when your using Nuxt anyways, However if you add these into Directus it should solve your cors errors.

  CONTENT_SECURITY_POLICY_DIRECTIVES__MEDIA_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"
  CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"
  CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"
  CONTENT_SECURITY_POLICY_DIRECTIVES__CONNECT_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"

from agency-os.

jbool24 avatar jbool24 commented on August 18, 2024

@daver987 Thanks, I'll give that a try.

Even if this works, I still think there might still be an unexpected bug. The only error difference I see between a fresh install of this stack as a control to test against my "half-production" setup is the Origin error. I feel like the code responding from Directus may have just forgot to include that headers because I can't make it show up no matter how/what I config in the ENV vars. The error below is an example error after the ENV vars are configured as in the original post (CORS_ENABLED, CORS_ORIGIN}.

signin:1 Access to fetch at 'https://cms.[REDACTED].com/auth/login' from origin 'http://[REDACTED].test:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

from agency-os.

jbool24 avatar jbool24 commented on August 18, 2024

@bryantgillespie this wasn't resolved. Please re-open

from agency-os.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.