3

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 [email protected]. 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
  • [email protected] seems valid, but with the Error 502 I'm not sure
  • [email protected] is valid
  • [email protected] 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)

2
  • The main part of the validation happens via $dnsRecords = @dns_get_record($host, DNS_MX + DNS_A + DNS_AAAA); - so I'm assuming that called directly, outside of any Laravel wrappers, would get you the same kind of response? Commented Oct 10, 2024 at 6:22
  • "This problem was found on my test environment hosted on AWS, it doesn't works" - might be a problem with the specific DNS resolver that system uses then. What happens when you try to make an HTTP request to that domain name from that system, or try to ping it? Commented Oct 10, 2024 at 6:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.