mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: bug fix
This commit is contained in:
1 parent
3f337e41c3
commit
e2d8df1428
1 file changed
+2
-2
@@ -19,8 +19,8 @@ export default async (ctx, next) => {
|
||||
const isWebsocket = ctx.request.headers.upgrade === 'websocket';
|
||||
const [xff, xhost] = system.getMany(['server.xff', 'server.xhost']);
|
||||
// ignore reverse_proxy chains
|
||||
const ipHeader = ctx.request.headers[xff?.toLowerCase() || ''];
|
||||
const ip = (typeof ipHeader === 'string' ? ipHeader : ipHeader[0] || ctx.request.ip).split(',')[0].trim();
|
||||
const ipHeader = ctx.request.headers[xff?.toLowerCase() || ''] || ctx.request.ip;
|
||||
const ip = (typeof ipHeader === 'string' ? ipHeader : ipHeader[0]).split(',')[0].trim();
|
||||
const host = ctx.request.headers[xhost?.toLowerCase() || ''] as string || ctx.request.host;
|
||||
const request: HydroRequest = {
|
||||
method: ctx.request.method.toLowerCase(),
|
||||
|
||||
Reference in new issue
Block a user