소스 검색

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