Skip to content

Commit e5e243d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d41cedc commit e5e243d

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/configproxy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,14 @@ export class ConfigurableProxy extends EventEmitter {
391391
proxyOptsForTarget(target, reqUrl) {
392392
var proxyOptions = { target };
393393

394-
if (target.protocol.startsWith('unix')) {
394+
if (target.protocol.startsWith("unix")) {
395395
proxyOptions.secure = false;
396396
proxyOptions.target.socketPath = decodeURIComponent(target.host);
397-
proxyOptions.target.pathname = (target.pathname ? target.pathname + '/' : '') + reqUrl;
397+
proxyOptions.target.pathname = (target.pathname ? target.pathname + "/" : "") + reqUrl;
398398
} else {
399399
// No need for agents for unix sockets
400-
// No support for https for unix sockets
401-
proxyOptions.secure = (target.protocol.slice(-2) === "s:");
400+
// No support for https for unix sockets
401+
proxyOptions.secure = target.protocol.slice(-2) === "s:";
402402

403403
if (proxyOptions.secure) {
404404
proxyOptions.agent = this.httpsAgent;

test/proxy_spec.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,12 @@ describe("Proxy Tests", function () {
515515

516516
it("proxy to unix socket test", function (done) {
517517
var proxyPort = 55557;
518-
var unixSocketUri = '%2Ftmp%2Ftest.sock';
518+
var unixSocketUri = "%2Ftmp%2Ftest.sock";
519519

520520
util
521521
.setupProxy(proxyPort, {}, [])
522-
.then((proxy) =>
523-
util.addTarget(proxy, "/unix", 0, false, null, null, unixSocketUri)
524-
)
525-
.then(() => fetch("http://127.0.0.1:" + proxyPort + '/unix'))
522+
.then((proxy) => util.addTarget(proxy, "/unix", 0, false, null, null, unixSocketUri))
523+
.then(() => fetch("http://127.0.0.1:" + proxyPort + "/unix"))
526524
.then((res) => {
527525
expect(res.status).toEqual(200);
528526
})

0 commit comments

Comments
 (0)