From 9548d7ae33d2e5a303fb0663df0b466dff792611 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 12 Apr 2022 11:09:35 +0800 Subject: [PATCH] bugfix --- ahserver/proxyProcessor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ahserver/proxyProcessor.py b/ahserver/proxyProcessor.py index 373d933..06f17d1 100644 --- a/ahserver/proxyProcessor.py +++ b/ahserver/proxyProcessor.py @@ -1,4 +1,5 @@ -from aiohttp import web +import aiohttp +from aiohttp import web, BasicAuth from aiohttp import client from .baseProcessor import * @@ -23,9 +24,13 @@ class ProxyProcessor(BaseProcessor): chunk_size = 40960 d = await self.path_call(request) reqH = request.headers.copy() + auth = None + if d.get('user') and d.get('password'): + auth = BasicAuth(d['user'], d['password']) async with client.request( request.method, d['url'], + auth=auth, headers = reqH, allow_redirects=False, data=await request.read()) as res: