and the problem is in the requested resource, if it is changed to "POST /Default.aspx HTTP/1.0" (so removing full host information) it works perfectly~~~PART OF FIRST POST

With a sample application I can emulate the bad request and also fix by changing the requested resource. In fact IIS, using the same .NET 4 processor, can serve perfectly the request which means they do something different from Ultidev and which Ultidev can do as well.

Could you please take in consideration the above example? Perhaps .NET 4 is appending the HOST before the resource or something similar very simple making the request bad when the browser will receive such request info, but this can be easily verified by you in debugging by changing the resource as per above while debugging.

Normally this should be fine also in general according HTTP specifications, so perhaps you can find a fix by changing it, when running on .NET 4, if you receive such requests which we know will be considered bad by the framework.

IIS does not use exactly the same request processor. In fact, .NET Framework 4 has a completely one-off, IIS-specific, closed version of the request processor: http://referencesource.m...ng/IIS7WorkerRequest.cs - just for IIS. It results in several differences in how requests are processed by IIS and everyone else. Also, IIS appears to be using low-level C/C++ interface with http.sys driver, and the not HttpListener .Net class - a simplified version with lots of restrictions, exposed to the .NET world. In other words, IIS request processing pipeline is proprietary, much more low-level and vastly more complex.

We do not have an opportunity to change the request after it came from HttpListener class as the request is already ingested and pre-parsed by the http.sys driver. We simply take it and hand it off to the HttpRuntime.ProcessRequest(), which then tells us to return 400 in the response.

We try to be as compatible with IIS as possible, but in order to be 100% compatible, we'd have to rewrite IIS.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.