-1

I am creating a chrome extension that need to send post request to a server over normal http but this causes a mixed content error and browser don't process the request when I am in a website that user Https.

error message:

Mixed Content: The page at 'https://www.google.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://example.se:8080/v1/check'. This request has been blocked; the content must be served over HTTPS.

    var settings = {
  "url": "http://example.se:8080/v1/check",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "postman-token": "e7705111-e7d7-0284-e4cd-56115243e076",
    "Content-Type": "application/json"
  },
  "data": JSON.stringify({"langCode":"pt-rr","text":"Por favor, leia as regrs. Meu nom é Nicolas. bowré o qunto maor pabn dks do."}),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
awabs
  • 101
  • 1
  • 8
  • 2
    Why does it need to be sent over HTTP? Do you have access to the webserver? Upgrading to HTTPS is really the solution here. – zeterain Nov 17 '20 at 15:51
  • I don't have access to the server, that's why I am trying to find a way around – awabs Nov 17 '20 at 19:02

1 Answers1

1

It is not recommendable to use mix-content, You should use HTTPS.

But if you want to bypass it for Development Purpose, You can allow it in site settings.

Refer this question How to get Chrome to allow mixed content?

BadPiggie
  • 5,471
  • 1
  • 14
  • 28