Adding UseCookieConsent to Umbraco causes HTTP 417: Expectation Failed in the back office

27 views Asked by At

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?

0

There are 0 answers