5

I am serving static content (html, css and js) using lighttpd. I want to call api from a server hosted on the localhost using a wsgi application with python. I am getting the following error when I am trying to call the api from frontend (using ajax with jquery library). error screenshot

I am accessing the site via brave browser. For testing purpose how can I disable this "Cross-Origin Read Blocking (CORB) blocked cross-origin response" feature?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Tahlil
  • 1,031
  • 1
  • 14
  • 26

1 Answers1

0

You can prevent MIME sniffing by setting the response header option X-Content-Type-Options to nosniff. For lighttpd the syntax is:

setenv.add-response-header = ("X-Content-Type-Options" => "nosniff",)
Tahlil
  • 1,031
  • 1
  • 14
  • 26
  • Thanks, but more importantly than adding "X-Content-Type-Options: nosniff" response header, I had to make sure that the correct "Content-Type" response header for the served resource was set, e.g. for the site's favicon I gotta set it to `Content-Type: image/x-icon`. – Glenn Mohammad Oct 31 '22 at 12:40