Copied to clipboard

Flag this post as spam?

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


  • Tom Jones 19 posts 150 karma points
    Mar 19, 2024 @ 10:10
    Tom Jones
    0

    Adding cookie consent causes HTTP 417: Expectation Failed in the back office

    Hi folks, I added a cookie consent banner to my website using the standard .NET UseCookieConsent() middleware. However, this started throwing 417 error codes in the back office, resulting in the nodes failing to load and the backoffice becoming completely unusable - the same happens when deployed to my remote host. Error message shown below:

    GET https://localhost:44318/umbraco/backoffice/umbracoapi/backofficeassets/GetSupportedLocales 417 (Expectation Failed)

    Possibly unhandled rejection: {"errorMsg":"Failed to get cultures","data":{"Type":null,"Title":null,"Status":417,"Detail":null,"Instance":null,"Extensions":{"traceId":"00-d9b0ecde07e5815e972858eade6a6394-afc12ffd089185a8-00"}},"status":417,"xhrStatus":"complete"}

    Additional errors with the same error code are raised for the following API calls:

    • GetCheck
    • AllowsCultureVariation
    • GetSections
    • GetTours

    This may relate to the ValidateAngularAntiForgeryTokenAttribute , which returns an error from the call to ValidateRequestAsync on BackOfficeAntiforgery, which then throws the Expectation Failed result, however I don't know how to resolve this issue from my side without there being changes to the Umbraco source code.

    Any ideas?

  • Alan Mitchell 57 posts 281 karma points c-trib
    Mar 19, 2024 @ 20:15
    Alan Mitchell
    0

    By coinicidence, I'm dealing with the same issue! I think this is relevant ... https://our.umbraco.com/forum/using-umbraco-and-getting-started/107782-reverting-content-http-417s-and-strange-azure-behaviour#comment-335191

    I'm going to try setting backoffice cookies to be regarded as necessary ... as soon as I figure out which ones are strictly necessary.

  • Tom Jones 19 posts 150 karma points
    Mar 19, 2024 @ 20:47
    Tom Jones
    0

    Hi Alan, how do you specify cookie necessity? Is it something in the Startup class? I'm using Umbraco V10.

Please Sign in or register to post replies

Write your reply to:

Draft