• Resolved devcn

    (@devcn)


    Hi there,

    First, thank you for this plugin, really helpful and easy to use!

    The Access-Control-Allow-Origin HTTP header is set to * (which is supposed to allow everything) but whenever I query the API of my WP blog, I don’t see this header in the response (or sometimes I see it but not with the value I defined).

    I also tried debugging with the “Inspect headers” feature of the plugin but the header is never present.

    I probably miss something obvious or maybe there is something else (maybe another plugin?) messing around with the HTTP headers…

    Note (if that’s important?) that my blog is hosted on wordpress.com

    Help (or at least hints) greatly appreciated!

    Thank you

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dimitar Ivanov

    (@zinoui)

    Hi @devcn

    Access-Control headers are applied only when the Origin header is found in the request. It is sent with CORS requests, as well as with POST requests.

    Hope this helps you.
    Regards

    Thread Starter devcn

    (@devcn)

    Hi @zinoui,

    Thank you for the quick reply.

    The Origin header is always set with the correct URL.

    Sometimes I have the following error:

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [REQUESTED URL]. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)

    But I don’t explain why… probably another plugin doing weird stuff with HTTP headers…

    Since the feature I try to fix isn’t really important, I ended up using the following working solution: https://stackoverflow.com/a/57951582 (I already wasted too much time on it)

    Anyway, thank you again your plugin (even if I ended up not using it) and your time.

    Regards

    Plugin Author Dimitar Ivanov

    (@zinoui)

    You’re welcome.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[API] Access-Control-Allow-Origin defined but not present’ is closed to new replies.