javascript - IIS is executing request even if CORS is disabled -
i have 2 mvc asp.net applications. i'm trying make ajax post request 1 app another. default cors should have been disabled, , i'm getting alert in console:
xmlhttprequest cannot load http://localhost:2211/home/form. no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:2282' therefore not allowed access.
so should right. but...
i realized request executed specific action on http://localhost:2211. how possible? why request executed though cors had been disabled?
the request http://localhost:2211/home/form
made, response request did not contain access-control-allow-origin
header results in browser declining process response you.
until server responds request that's been made it, providing header, browser won't know if request was/is permitted or not, i.e. onus on browser react access-control-allow-origin
header, rather server.
you may see different behaviours here depending on browser you're using as, example:
internet explorer not consider port when comparing origins.
Comments
Post a Comment