fix more issues
This commit is contained in:
parent
bd83a66052
commit
7476d647bb
|
@ -13,8 +13,7 @@ import { IoReloadCircleSharp } from 'react-icons/io5';
|
||||||
import { shardOrigin } from '../store/actions/fetch';
|
import { shardOrigin } from '../store/actions/fetch';
|
||||||
|
|
||||||
async function getUrlAndId() {
|
async function getUrlAndId() {
|
||||||
// const url = `${shardOrigin}/captcha.svg`;
|
const url = `${shardOrigin}/captcha.svg`;
|
||||||
const url = '/captcha.svg';
|
|
||||||
const resp = await fetch(url, {
|
const resp = await fetch(url, {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
});
|
});
|
||||||
|
|
|
@ -53,8 +53,8 @@ function ip4NumToStr(ipNum) {
|
||||||
export function getHostFromRequest(req, includeProto = true, stripSub = false) {
|
export function getHostFromRequest(req, includeProto = true, stripSub = false) {
|
||||||
const { headers } = req;
|
const { headers } = req;
|
||||||
let host = headers['x-forwarded-host']
|
let host = headers['x-forwarded-host']
|
||||||
|| headers.host
|
|| headers[':authority']
|
||||||
|| headers[':authority'];
|
|| headers.host;
|
||||||
if (stripSub) {
|
if (stripSub) {
|
||||||
if (host.lastIndexOf('.') !== host.indexOf('.')) {
|
if (host.lastIndexOf('.') !== host.indexOf('.')) {
|
||||||
host = host.slice(host.indexOf('.'));
|
host = host.slice(host.indexOf('.'));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user