mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix(proxy): convert auth in URL to basic auth header
This commit is contained in:
@@ -325,6 +325,16 @@ router.all(
|
||||
? getProxyAgent(Env.ADDON_PROXY![proxyIndex])
|
||||
: undefined;
|
||||
const headers = { ...clientHeaders, ...data.requestHeaders };
|
||||
if (urlObj.username && urlObj.password) {
|
||||
const basicAuth = Buffer.from(
|
||||
`${decodeURIComponent(urlObj.username)}:${decodeURIComponent(
|
||||
urlObj.password
|
||||
)}`
|
||||
).toString('base64');
|
||||
headers['authorization'] = `Basic ${basicAuth}`;
|
||||
urlObj.username = '';
|
||||
urlObj.password = '';
|
||||
}
|
||||
currentUrl = urlObj.toString();
|
||||
logger.debug(`[${requestId}] Making upstream request`, {
|
||||
username: auth.username,
|
||||
|
||||
Reference in New Issue
Block a user