bug: url parser

fixes #564
This commit is contained in:
2023-05-17 20:37:25 +01:00
parent 167f1c5e65
commit cefc21709a
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import useImgProxy from "Hooks/useImgProxy";
import { useEffect, useState } from "react";
import { FormattedMessage } from "react-intl";
import { getUrlHostname } from "Util";
interface ProxyImgProps extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
size?: number;
@ -34,7 +35,7 @@ export const ProxyImg = (props: ProxyImgProps) => {
<FormattedMessage
defaultMessage="Failed to proxy image from {host}, click here to load directly"
values={{
host: new URL(src ?? "").hostname,
host: getUrlHostname(src),
}}
/>
</div>