takahe icon indicating copy to clipboard operation
takahe copied to clipboard

Prevent Cloudflare from treating handles as emails

Open ewpratten opened this issue 1 year ago • 5 comments

A display issue occurs when a Takahē instance is hosted behind a Cloudflare proxy and Cloudflare's Email Address Obfuscation feature is enabled.

Due to the format of handles, Cloudflare treats them as email addresses, and will cause them to display as @[email protected]. See below for an example:

Screenshot from 2023-05-07 12-33-31

Luckily, Cloudflare provides a way to force-disable false positives.

This PR wraps every instance of @{{identity.handle}} I could find with the "magic comments" to force-disable email protection, and stop Cloudflare from hiding handles.

ewpratten avatar May 07 '23 16:05 ewpratten

@ewpratten for me this behaviour was only happening on django's hx-swap/hx-get action (like clicking on the refresh button on the homepage), not on the initial page load - which made me think it's got to do with the fact that's it's a non-json AJAX. Were you seeing this on the first page load as well?

karthikb351 avatar May 07 '23 17:05 karthikb351

I see this on every page load, but only on the home timeline

ewpratten avatar May 07 '23 17:05 ewpratten

Surely there must be some way to turn this off on the Cloudflare side? I really am not a fan of changing HTML output just to satisfy one commercial vendor.

andrewgodwin avatar May 08 '23 05:05 andrewgodwin

There is, but that would also turn off actual email obfuscation. Plus, if I remember correctly, only higher tier customers get to pick and choose which subdomains have the feature enabled.

On Mon, May 8, 2023, 01:05 Andrew Godwin @.***> wrote:

Surely there must be some way to turn this off on the Cloudflare side? I really am not a fan of changing HTML output just to satisfy one commercial vendor.

— Reply to this email directly, view it on GitHub https://github.com/jointakahe/takahe/pull/572#issuecomment-1537753754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFAW5REFZPLKWS5WR5K4TITXFB5IZANCNFSM6AAAAAAXY7WTV4 . You are receiving this because you were mentioned.Message ID: @.***>

ewpratten avatar May 08 '23 13:05 ewpratten

I'm going to icebox this for a while as I think about it - as far as I'm concerned this is really a Cloudflare bug, so I'm not in a huge rush to support it.

andrewgodwin avatar May 08 '23 16:05 andrewgodwin