502 response from function on first request

Please help, I created a small function to send mail via maligun api. For some strange reason, on mobile devices only (iPhone & iPad), first send will return a 502 error but when i click the button again, It works all perfectly fine.

The error seems to only happen in safari, the httpErrorResponse is unknown. Anybody has an idea?

Cheers
Olaf

hi there, before we dig in, did you look through other folks posts on 502 errors here in Community?

https://answers.netlify.com/search?expanded=true&q=502%20error

There may be something existing that points you in the right direction!

After bit more digging, I narrowed it down to be Safari issue and Angular HttpClient post. Still no idea how to resolve it. It works perfectly fine in Chrome but first post to the endpoint from Safari will return an unknown error but if you click the button again, it gets send. Testing it locally, I am getting an timeout error, I will check the callback, perhaps something is not quite right.

Thanks

1 Like