1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Laravel - Error 502 "Bad Gateway" when using a email:dns validation

Discussão em 'Outras Linguagens' iniciado por JGaouette, Outubro 9, 2024 às 16:43.

  1. JGaouette

    JGaouette Guest

    I use Laravel (v9.52.16) with Inertia.

    In front-end (Vue.js) I have an email field and in back-end (PHP 8.1.22) I do validations. I use RFC and DNS validationsto authorize only valid emails with valid DNS. (https://laravel.com/docs/9.x/validation#rule-email).

    Everything works fine, for valid email and invalid email, but my QA team tried the email not@valid.com. But for this one, it triggers the Error 502 "Bad Gateway" after 10s waiting for the server response.

    Request::validate([
    'email' => ['required', 'email:rfc,dns'],
    ]);


    What you need to know:

    • On localhost it works
    • This problem was found on my test environment hosted on AWS, it doesn't works
    • not@valid.com seems valid, but with the Error 502 I'm not sure
    • not@valid.ca is valid
    • not@valid.comm is not valid
    • I tried without the DNS validator ('email:rfc') the email is valid

    I was wondering if the problem wasn't coming directly from DNS, because everything works with the rest. So I got the domain information, but I can't find anything that explains the problem.

    https://www.whois.com/whois/valide.com (DNS not working)
    https://www.whois.com/whois/valide.ca (Working DNS for comparison)

    Continue reading...

Compartilhe esta Página