Troubles to run my project on google chrome at a customer


#1

Hello,

With a workmate, we are deploying a web project to a customer, we are encountering troubles to run it.
Our web application consumes REST Api web service and it runs on Internet Explorer 11, not on google chrome (version 62.0.3202.94), this error message is displayed : Response with status: 0 for URL: null
I also installed the allow control allow origin application, even if I disable and enable it, I continue to have the same error message, any idea?
In case the solution is here, I put the code contained in the main.js file to generate the http header :

AppService.prototype.getHeaderWS = function () {
        var myHeaders = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]();
        myHeaders.append('Accept', 'application/json');
        myHeaders.append('Content-Type', 'application/json');
        myHeaders.append('Access-Control-Allow-Origin', '*');
        myHeaders.append('Access-Control-Allow-Methods', 'POST, GET, OPTIONS');   
		myHeaders.append('Authorization','Bearer CE8F9C763E919C7600000000F700FC0580F6142EE61E72B3867DAFEC900AE7C0A54746A9C2E1BF35BF50798B21997EF89');
		return myHeaders;
    };

Thanks


#2

Where do you have the problem: Internet Explorer 11 or Google Chrome 62?
What error message are you getting?
What is that code you posted here?


#3

I get this error message on google chrome : Response with status: 0 for URL: null
The web application works on Internet Explorer 11, and as I said, it’s the content of the main.js file, from the www/build folder, and according to me, the error comes from the http header


#4

You don’t “allow origins” in the consuming app, that happens on the providing server.

To get the actual error, look at the browser’s dev tool’s network panel.


#5

I actually encounter the http error 403, I also edited the web.config file from the root of the www folder, I put this :

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <system.webServer>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
       <add name="Access-Control-Allow-Methods"  value="POST, GET, OPTIONS" />
	   <add name="Accept" value="application/json" />
	   <add name="ContentType" value="application/json" />
	   <add name="Authorization" value="Bearer CE8F9C763E919C7600000000F700FC0580F6142EE61E72B3867DAFEC900AE7C0A54746A9C2E1BF35BF50798B21997EF89" />
	</customHeaders>
   </httpProtocol>
 </system.webServer>
</configuration>

But nothing changed, IE11 is actually the only browser I can use to run my web project


#6

IE11 doesn’t implement CORS probably. All modern browsers do.

You have to find a way to correctly configure your server. Pretty much out of scope for Ionic.


#7

Does MS Edge implement CORS too? I found no info.
and okay, I will open an issue on here, and thanks for everything.