Quantcast
Viewing all articles
Browse latest Browse all 5794

HTTP status code returned by site-wide error handler is 200 OK?

I'm using a developer install of ColdFusion 11. I set up the following page at http://localhost:8500/test/index.cfm:

<cfthrow type="application" message="This is an error">

 

When I visit that page, the HTTP status code returned is 500, as expected.

 

I then created the following page at http://localhost:8500/error.cfm:

<p>Sorry! That was an error.</p>

 

If I set the site-wide error handler in the CF Admin to /error.cfm and visit /test/index.cfm, the HTTP status code returned is 200 OK.

 

This seems weird to me. It looks like I can include the following in the error.cfm file to send an error code instead:

<cfheader statuscode="500" statustext="Server Error">

 

Does anyone see that as problematic? Is there a reason why the site-wide error handler should return 200 OK?

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 5794

Trending Articles