Cloudflare not passing through 400 error object or messages?

firewall

#1

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’});

or
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!


#2

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

Would you have a demo URL?


#3

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


#4

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:


#5

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


#6

You can run a test at sitemeer.com 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.


#7

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


closed #8

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