Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Amri 214 posts 740 karma points
    Sep 15, 2021 @ 11:58
    David Amri
    0

    CORS in Umbraco backoffice

    Hi,

    Packages in the Developer section of the backend wont load. Get a CORS error message.

    Access to XMLHttpRequest at 'https://our.umbraco.org/webapi/packages/v1' from origin 'XXX' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    I've added the "Access-Control-Allow-Origin" policy in the web.config file but it's not working, get the same message. Do I have to download any of the CORS nuget for this to work? If so wich one as there are mutliple.

    / Cheers

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 15, 2021 @ 13:32
    Sven Geusens
    0

    "Access-Control-Allow-Origin" means that the endpoint you are trying to hit has incorrect CORS configured (as far as i know), so it's an error on Umbraco's side.

  • David Amri 214 posts 740 karma points
    Sep 15, 2021 @ 13:35
    David Amri
    0

    I was thinking the same but I find this a bit strange. Surely I would not be the only one having the same issue... :)

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 15, 2021 @ 13:39
    Sven Geusens
    0

    What version of umbraco are you running?

  • David Amri 214 posts 740 karma points
    Sep 15, 2021 @ 13:40
    David Amri
    0

    7.11.1

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 15, 2021 @ 13:42
    Sven Geusens
    0

    Let me spin one up quickly

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 15, 2021 @ 13:42
    Sven Geusens
    0

    I am receiving the following response on the preflight check from an umbraco 8.13, so seems alright to me, this is in chrome and it is usually very difficult about CORS

    enter image description here

  • David Amri 214 posts 740 karma points
    Sep 15, 2021 @ 13:53
    David Amri
    0

    This is what I get:

    enter image description here

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 15, 2021 @ 14:08
    Sven Geusens
    0

    and the request headers?

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 15, 2021 @ 14:10
    Sven Geusens
    0

    I can't seem to be able to spin up a 7.11.1 version (must not have the correct .net framework installed). Is there a reason why you are working in such an old version of umbraco? (released 26/06/2018)

  • David Amri 214 posts 740 karma points
    Sep 15, 2021 @ 14:22
    David Amri
    0

    I see. enter image description here

    Well, I'm not working with the site full time. The time it takes to make sure the upgrade works as expected and nothing has broken on the way has left me behind I'm afraid.

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 15, 2021 @ 14:29
    Sven Geusens
    0

    Yeah, it seems that whatever library/configuration Umbraco used in 7.11.1 to make that api request does not send the correct headers.

    enter image description here

    Maybe it's time to remake the site in a newer version and enjoy security updates again? Umbraco 9 is coming out soon ;)

  • sanjayrawat11 3 posts 23 karma points
    Feb 28, 2022 @ 10:19
    sanjayrawat11
    0

    Hi, do u got the solution for this, as I am also facing same issue..

Please Sign in or register to post replies

Write your reply to:

Draft