Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

IE 11 doesn't send CORS 'POST' request to the app

$
0
0

In my DEV machine I've got a web application (SharePoint site) and a simple ASP.NET MVC app both in the same instance of IIS. They have different domains (but both use SSL):

- SharePoint web application has a URL like "https://sp-dev.company.com" with a certificate issued by CA of the company.

- MVC web app has just a self-signed certificate and URL like "https://localhost:44303"

SharePoint site's home page has a ScriptEditor web part which merely "injects" JavaScript code on the page that queries the MVC app:

jQuery.support.cors = true;

$.ajax({    crossDomain: true,    url: requestUrl,    type: "POST",    data: JSON.stringify(payload),    dataType: 'json',    headers: {        "accept": "application/json;charset=utf-8",        "Content-Type": "application/json;charset=utf-8"    },    success: function (data) {
 ...;    },    error: function (err) {        ...;    }});

The problem is: when I run this code in IE 11 it hits breakpoints within MVC app (i.e. request actually gets the application) when MVC app runs in IIS Express. But IE 11 seems to block the request, not even letting it out to the application pool, when the MVC app runs in 'real' IIS. And the error that I see in the latter case is 

XMLHttpRequest: Network Error 0x80070005, Access is denied.

What can be the reason? I guess, I tried everything, from adding in web.config elements like

    <httpProtocol>      <customHeaders>        <add name="Access-Control-Allow-Origin" value="*" />        <add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS, PUT, DELETE" />        <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />      </customHeaders>    </httpProtocol>

to enabling CORS in Startup.Configuration() method like

public class Startup
{    private static readonly EsClosureConfiguration EsClosureConfigSection = WebConfigurationManager.GetSection(Constants.ESClosureConfigSectionName) as EsClosureConfiguration;    public void Configuration(IAppBuilder app)    {        //// ConfigureAuth(app);        app.UseCors(CorsOptions.AllowAll);

and adding URLs of the sites in different zones in IE. Nothing helps. Maybe I'm digging in a wrong direction?


v


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>