diff --git a/src/components/Captcha.jsx b/src/components/Captcha.jsx index 2989057..54d4fea 100644 --- a/src/components/Captcha.jsx +++ b/src/components/Captcha.jsx @@ -13,8 +13,7 @@ import { IoReloadCircleSharp } from 'react-icons/io5'; import { shardOrigin } from '../store/actions/fetch'; async function getUrlAndId() { - // const url = `${shardOrigin}/captcha.svg`; - const url = '/captcha.svg'; + const url = `${shardOrigin}/captcha.svg`; const resp = await fetch(url, { cache: 'no-cache', }); diff --git a/src/utils/ip.js b/src/utils/ip.js index 6f578fd..0bb9abc 100644 --- a/src/utils/ip.js +++ b/src/utils/ip.js @@ -53,8 +53,8 @@ function ip4NumToStr(ipNum) { export function getHostFromRequest(req, includeProto = true, stripSub = false) { const { headers } = req; let host = headers['x-forwarded-host'] - || headers.host - || headers[':authority']; + || headers[':authority'] + || headers.host; if (stripSub) { if (host.lastIndexOf('.') !== host.indexOf('.')) { host = host.slice(host.indexOf('.'));