Error validation, no return message

Hello, mine system is not returning the treated messages, locally on the server it works, however when going through the cloudflare it ignores the edit messenger to default
exemple
internal

External cloudflare

IIS ASP NET 4.0
controller I’m using
[HttpPost, ValidateInput(false)]
[ValidateAntiForgeryToken]
[GeraLocalAcesso]
public ActionResult CarregaInstituicao()
{
ModelState.Clear();
if (ModelState.IsValid)
{
try
{
var retorno = Modelo.salvarInstituicao(Modelo.InstituicaoCRUD);
}
catch (ValidacaoException ex)
{
Response.StatusCode = 400;
Response.StatusDescription = (“Erro:\n” + ex.Erro() + “\n\nDica:\n” + ex.Dica()).Replace("\n", “#”);
}
catch (Exception ex)
{
Response.StatusCode = 500;
Response.StatusDescription = (“Erro:\nOcorreu um erro inesperado no sistema\n\nDica:\n” + ex.ToString()).Replace("\n", “#”);
}
}
return Json("Sucesso " + retorno);
}
SSL configuration is flex ,
I’ve already done tests disabling https,
disabling all ssl,
HTTP/2 disabled

I have exhausted the options I have knowledge.

Firstly, please fix your SSL. You should not disable HTTPS/SSL, it will create an insecure connection for yourself and all visitors. Please fix that and set your SSL Mode to “Full (Strict)”

After that, I’m not sure if Cloudflare will keep a modified status text. You shouldn’t use status text for error messages though, you should use the returned body.

1 Like

yes it was just a test
cloudflare does not store the message body?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.