Different error output between localhost and a remote host

In one of my ISAPI projects I set the HTTP status code to 400 or 500 in case of an error. I also add some more data (in the body) to give the user a better error message. On my development PC everything works fine. If I deploy the ISAPI I don’t get the additional body text. After a search on the web I found the solution:

https://stackoverflow.com/questions/3993941/in-iis7-5-what-module-removes-the-body-of-a-400-bad-request
https://gist.github.com/remi/929007

Thank you guys.

After setting the httpError „existingResponse“ to „PassThrough“ in web.config it works.

<?xml version="1.0"?>
<configuration>
  <system.webServer>
    <httpErrors existingResponse="PassThrough"></httpErrors>
  </system.webServer>
</configuration>

2 Gedanken zu „Different error output between localhost and a remote host

Hinterlasse einen Kommentar