Browse Source

Remove Referer header when clicking on shortlinks.

This both hides the origin's hostname from external servers, and fixes
referer checks in some services (like the qBittorrent web UI).
Taddeus Kroes 5 ngày trước cách đây
mục cha
commit
3f8153b54f

+ 1 - 1
ui/src/EditPage/Link/Link.tsx

@@ -12,7 +12,7 @@ export const Link = ({ name, host }: LinkProps) => {
   return (
     <div className={css.root}>
       <div className={css.link}>
-        <a href={url}>{url}</a>
+        <a href={url} rel="noreferrer">{url}</a>
       </div>
       <Copy text={url} />
     </div>

+ 1 - 1
ui/src/LinksPage/LinksView/ShortLink/ShortLink.tsx

@@ -7,7 +7,7 @@ export interface ShortLinkProps {
 export const ShortLink = ({ url }: ShortLinkProps) => {
   return (
     <div className={css.shortlink}>
-      <a href={ensureHttp(url)}>{stripScheme(url)}</a>
+      <a href={ensureHttp(url)} rel="noreferrer">{stripScheme(url)}</a>
     </div>
   );
 };