I have a server very much like the example in http://webserver.codeplex.com/Thread/View.aspx?ThreadId=78947
Server server = new Server();
// Load file resources from c:\\temp
server.Add(new FileResources("/files/", "C:\\temp\\"));
// Only decode forms of type application/multi-part
// Serve files from the built in resource provider
server.Add(new FileModule(server.ResourceProvider, false));
// Only using one listener (could use many different ones)
HttpListener listener = HttpListener.Create(IPAddress.Any, 8085);
// start server (can have 5 pending accepts)
I nocticed that it does not respond on a OPTIONS header.
On this I don't get any reply (using wireshark).
OPTIONS /getconfiguration?_=1293186249649 HTTP/1.1
User-Agent: Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7E18
Access-Control-Request-Headers: X-Requested-With, Accept
Accept-Encoding: gzip, deflate
Anyone who know why I will not get a reply on this header ?
I would expect some reply like this:
HTTP/1.1 200 OK
Date: Mon, 01 Dec 2008 01:15:39 GMT
Server: Apache/2.0.61 (Unix)
Access-Control-Allow-Methods: POST, GET, OPTIONS
Keep-Alive: timeout=2, max=100
Please note that I am working on implementing CORS to overcome the same origin policy.
I have two webservers (say A and B) when I browse to A and make ajax calls to B,
it works using CORS headers. But when I browse to B and make ajax calls to A,
it does not work because A (the server above) does not respond on the OPTIONS header.
Dec 29, 2010 at 2:14 PM
A should respond with a Bad Request message. I had not added OPTIONS to the enum that I use to validate requests. I've fixed that now (version 2.0).