knadh / listmonk

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
https://listmonk.app
GNU Affero General Public License v3.0
14.46k stars 1.32k forks source link

Safari has issues with HTTP 307 generated by TrackLink #1941

Open usverger opened 1 month ago

usverger commented 1 month ago

Version:

Description of the bug and steps to reproduce: {{ TrackLink }} macro generates a link like this: https://hostname/link/1c11119e-82d3-469c-9253-5ca542c555ef/d11dc1c1-7943-48d9-8072-e0002ed3f446/e1198f57-6a46-4bf2-a7af-b097e41b647c. This link responds with HTTP 307 that is supposed to redirect to a real address. Apparently, Safari has issues with HTTP 307, both desktop and mobile. Instead of following the redirect, it shows an error page with "server unexpectedly dropped the connection" Any other browser works just fine.

Looking at url shortener services, they use HTTP 301 and safari seems to have no issues with it.

This feels like a major issue, makes link tracking unusable for all Apple recipients.

knadh commented 1 month ago

HTTP 307 being completely broken in Safari seems highly unlikely. I was unable to find any references to such an issue after searching for a few mins. Could you please share a few links that explain this?

usverger commented 1 month ago

I agree, I could not find much. I did find something about POST requests not preserving the payload, but this is not our case. It could also be an issue related to CORS: https://stackoverflow.com/questions/60227333/does-safari-handle-temporary-redirects-307-to-a-different-domain-correctly. My experiment of creating a simple app that responds with 307 did not confirm the issue as well. It worked in safari with no problems.

Here is the specific tracking link that does not work in safari. https://emailer.ainvest.com/link/9c99119e-82d3-469c-9253-5ca542c555ef/d29dc8c8-7943-48d9-8072-e0002ed3f446/e2498f57-6a46-4bf2-a7af-b097e41b647c

It happens with all tracking links generated by my instance of listmonk. So far I could not find what exactly is preventing safari to handle it properly.