浏览代码

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 天之前
父节点
当前提交
3f8153b54f
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      ui/src/EditPage/Link/Link.tsx
  2. 1 1
      ui/src/LinksPage/LinksView/ShortLink/ShortLink.tsx

+ 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>
   );
 };