Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed May 15, 2023
1 parent 66b4c63 commit 2c5ebd6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
3 changes: 1 addition & 2 deletions packages/agent-base/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ export abstract class Agent extends http.Agent {

get protocol(): string {
return (
this[INTERNAL].protocol ??
(isSecureEndpoint() ? 'https:' : 'http:')
this[INTERNAL].protocol ?? (isSecureEndpoint() ? 'https:' : 'http:')
);
}

Expand Down
4 changes: 3 additions & 1 deletion packages/agent-base/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ describe('Agent (TypeScript)', () => {
err = _err as Error;
}
assert(err);
expect(err.message).toEqual('Protocol "http:" not supported. Expected "other:"');
expect(err.message).toEqual(
'Protocol "http:" not supported. Expected "other:"'
);
});
});

Expand Down
5 changes: 4 additions & 1 deletion packages/pac-proxy-agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ export class PacProxyAgent<Uri extends string> extends Agent {
const servername = opts.servername || opts.host;
socket = tls.connect({
...opts,
servername: (!servername || net.isIP(servername)) ? undefined : servername,
servername:
!servername || net.isIP(servername)
? undefined
: servername,
});
} else {
socket = net.connect(opts);
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy-agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export type ProxyAgentOptions = HttpProxyAgentOptions<''> &
httpsAgent?: http.Agent;
/**
* A callback for dynamic provision of proxy for url.
* Defaults to standard proxy environment variables,
* Defaults to standard proxy environment variables,
* see https://www.npmjs.com/package/proxy-from-env for details
*/
getProxyForUrl?: GetProxyForUrlCallback;
Expand Down
4 changes: 2 additions & 2 deletions packages/proxy-agent/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('ProxyAgent', () => {

it('should call provided function with getProxyForUrl option', async () => {
let gotCall = false;
let urlParameter = "";
let urlParameter = '';
httpsServer.once('request', function (req, res) {
res.end(JSON.stringify(req.headers));
});
Expand All @@ -265,7 +265,7 @@ describe('ProxyAgent', () => {
gotCall = true;
urlParameter = u;
return httpsProxyServerUrl.href;
}
},
});
const requestUrl = new URL('/test', httpsServerUrl);
const res = await req(requestUrl, {
Expand Down
6 changes: 3 additions & 3 deletions packages/proxy/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const hostname = os.hostname();

export interface ProxyServer extends http.Server {
authenticate?: (req: http.IncomingMessage) => boolean | Promise<boolean>;
localAddress?: string;
localAddress?: string;
}

/**
Expand Down Expand Up @@ -196,7 +196,7 @@ async function onrequest(
...parsed,
method: req.method,
headers,
localAddress: this.localAddress
localAddress: this.localAddress,
});
debug.proxyRequest('%s %s HTTP/1.1 ', proxyReq.method, proxyReq.path);

Expand Down Expand Up @@ -415,7 +415,7 @@ async function onconnect(
const lastColon = req.url.lastIndexOf(':');
const host = req.url.substring(0, lastColon);
const port = parseInt(req.url.substring(lastColon + 1), 10);
const localAddress = this.localAddress
const localAddress = this.localAddress;
const opts = { host: host.replace(/^\[|\]$/g, ''), port, localAddress };

debug.proxyRequest('connecting to proxy target %o', opts);
Expand Down

1 comment on commit 2c5ebd6

@vercel
Copy link

@vercel vercel bot commented on 2c5ebd6 May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

proxy-agents – ./

proxy-agents.vercel.app
proxy-agents-tootallnate.vercel.app
proxy-agents-git-main-tootallnate.vercel.app

Please sign in to comment.