18 lines
334 B
JavaScript
18 lines
334 B
JavaScript
'use strict';
|
|
|
|
module.exports = self => {
|
|
const {username, password} = self.proxyOptions.url;
|
|
|
|
if (username || password) {
|
|
const data = `${username}:${password}`;
|
|
const authorization = `Basic ${Buffer.from(data).toString('base64')}`;
|
|
|
|
return {
|
|
'proxy-authorization': authorization,
|
|
authorization
|
|
};
|
|
}
|
|
|
|
return {};
|
|
};
|