cben / mathdown

Collaborative markdown with math
https://www.mathdown.net
Other
420 stars 46 forks source link

Referer policy: Don't send ?doc=SECRET in external links #219

Closed cben closed 9 months ago

cben commented 9 months ago

[extracted from view branch, this looks like a safe win]

Affects all requests made from the page. Notable external links:

Tested on Firefox (back in 2020).

doc: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#integration_with_html

cben commented 9 months ago

Hmm, now I don't see a change between mathdown.net and preview when clicking "bugs" link. Both send only the domain name to github e.g. Referer: https://deploy-preview-219--elastic-liskov-92f696.netlify.app/

I do see the meta tag had an effect — shows "Referrer Policy: origin" in devtools instead of default "Referrer Policy: strict-origin-when-cross-origin"

cben commented 9 months ago

confirmed, now stops ?doc=... from being sent even on same-origin ?doc=help link.