Why is CORS preflighted request missing origin attribute on Chrome and IIS 7.5?
-
First OPTIONS request is contain origin attribute, but second real request is not contain origin attribute. For example: Client request OPTIONS http://localhost:8091/role HTTP/1.1 Host: localhost:8091 Connection: keep-alive Referer: http://test.dev:9000/test.html Access-Control-Request-Method: GET Origin: http://test.dev:9000 Access-Control-Request-Headers: Content-Type, Accept Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.84 Safari/534.13 Accept-Encoding: gzip,deflate,sdch Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4 Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3 Server response HTTP/1.1 200 OK Server: Microsoft-IIS/7.5 Access-Control-Allow-Origin: http://test.dev:9000 Access-Control-Allow-Headers: CONTENT-TYPE, ACCEPT Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS X-Powered-By: http://ASP.NET Date: Sun, 06 Feb 2011 15:12:00 GMT Content-Length: 0 Client request GET http://localhost:8091/role HTTP/1.1 Host: localhost:8091 Connection: keep-alive Referer: http://test.dev:9000/test.html Content-Type: application/json; charset=utf-8 Accept: application/json User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.84 Safari/534.13 Accept-Encoding: gzip,deflate,sdch Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4 Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3 Server response HTTP/1.1 200 OK Cache-Control: private Content-Type: application/json; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNetMvc-Version: 3.0 X-AspNet-Version: 4.0.30319 X-Powered-By: http://ASP.NET Date: Sun, 06 Feb 2011 15:12:00 GMT Content-Length: 165
-
Answer:
It happens when the resource is accessed from localhost , which does not provide origin parameter.Even Firefox does it.
Ramesh Chandra at Quora Visit the source
Related Q & A:
- Why did he ignore my friend request?Best solution by Yahoo! Answers
- Will 7.5 trucks fit on a 7.75 deck?Best solution by answers.yahoo.com
- What size snowboard do I need if I am about 5'7?Best solution by frostyrider.com
- Why can't I answer a friend request on Facebook?Best solution by facebook.com
- How do you scale up a HO Gauge train to a 7.5 Gauge Live Steam?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.