fix more issues

This commit is contained in:
HF 2022-09-11 01:54:08 +02:00
parent bd83a66052
commit 7476d647bb
2 changed files with 3 additions and 4 deletions

View File

@ -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',
});

View File

@ -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('.'));