Cloudflare not passing through 400 error object or messages?

I have a node/express/angluar app that passes up 400 errors to angular on certain api calls. Recently I tried adding both a json error object as well as the statusMessage text. Both work fine locally. sample code:
res.status(400).json({errorMessage: ‘message here’});

res.statusMessage = ‘message here’;
return res.status(400).end();

However, once the app is in production and going through Cloudflare, that response no longer comes through. I haven’t gotten to the point of logging out the response yet in production to see if it’s just being modified somehow, but I wanted to see if there were docs somewhere stating this.

This support article seems to indicate this shouldn’t be happening.

Thanks in advance!

I just ran a quick test and a 400 was properly passed through.

Would you have a demo URL?

You were able to get the message through? I have the code up in a staging environment. If I turned Cloudflare off for he subdomain, it works. If I turn it on, the response to the call is just the 400 bad request

I got the message through and a JSON string.

Without a URL to test there is little point in discussing it any further though :wink:

Is there DM functionality here? I prefer to have my staging site in a public domain.

You can run a test at and tell me the exact time when you ran it. Do the same with the origin IP address so I can check it against the origin too.

it’s behind a user wall, so there needs to be some interaction with the site.

This topic was automatically closed after 14 days. New replies are no longer allowed.