Tim
02/13/2024, 9:29 PMhttpData = {
"statusCode": statusCode,
"statusText": statusText
};
cfheader(statuscode: statusCode, statustext: statusText);
cfheader(name: "Content-Type", value: "application/json");
WriteOutput(SerializeJSON(httpData));
And when the response is a 200, I do get JSON output. But on an error (412, for example), I'm not getting
{
"statusCode": 412,
"statusText": "My error message with what's missing"
}
Instead I'm getting the default IIS 412 page, which is HTML.Tim
02/13/2024, 9:32 PMResponse.TrySkipIisCustomErrors = true;
So that's not very helpful.Patrick
02/13/2024, 9:37 PMPatrick
02/13/2024, 9:37 PMPatrick
02/13/2024, 9:37 PMTim
02/13/2024, 9:43 PM<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpErrors existingResponse="PassThrough"/>
</system.webServer>
</configuration>
But it doesn't appear to be passing my responses through like I expected.James Harris
02/13/2024, 9:52 PM<remove statusCode="412" /> within the <httpErrors />Patrick
02/13/2024, 9:52 PMTim
02/13/2024, 9:54 PMJames Harris
02/13/2024, 9:54 PMPatrick
02/13/2024, 9:59 PMTim
02/13/2024, 9:59 PMTim
02/13/2024, 10:00 PMTim
02/13/2024, 10:23 PMTim
02/13/2024, 10:23 PMTim
02/14/2024, 3:37 PM<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpErrors existingResponse="PassThrough">
<remove statusCode="401"/>
<remove statusCode="412"/>
<remove statusCode="424"/>
</httpErrors>
</system.webServer>
</configuration>
Did I screw anything up there?Patrick
02/14/2024, 4:29 PMPatrick
02/14/2024, 4:29 PM<system.web>
<customErrors mode="Off"/>
</system.web>Patrick
02/14/2024, 4:30 PM<system.webServer> groupTim
02/14/2024, 10:54 PMPatrick
02/14/2024, 10:55 PMPatrick
02/14/2024, 10:55 PMTim
02/14/2024, 10:56 PMTim
02/14/2024, 10:57 PMPatrick
02/14/2024, 10:57 PM