-1

I am developing an app and just moved it behind a Shibboleth SSO running on Apache. Static pages behind Shibboleth work as expected, but when I use fetch("test.html") I get a CORS error. I have tried this with jQuery's $.ajax command, and I do not get the CORS error.

What is missing from the fetch command that jQuery fixes for me?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Jason Siefken
  • 737
  • 7
  • 12
  • What exactly do you mean by relative url? Unless you just mean protocol relative, a relative url would be same origin and therefore not subject to CORS policy. – Kevin B Aug 02 '18 at 21:11
  • Provide a [mcve] and **quote** the error message, don't just vaguely describe it. – Quentin Aug 02 '18 at 21:11

1 Answers1

0

It turns out jQuery.ajax and fetch differ in that fetch does not send credentials by default. fetch("test.html", { credentials: "same-origin" }) avoids the CORS error.

Jason Siefken
  • 737
  • 7
  • 12