From b1a51f9b49ef23f713fb9ba050c540972b1f140c Mon Sep 17 00:00:00 2001 From: Buluc-Celik-Ozbul <88420915+Buluc-Celik-Ozbul@users.noreply.github.com> Date: Wed, 29 Jun 2022 09:17:02 +0300 Subject: [PATCH] fix: Proxy-Authorization: Basic (#22471) Co-authored-by: buloheart Co-authored-by: Emily Rohrbough Co-authored-by: Matt Henkes Co-authored-by: Lachlan Miller --- packages/network/lib/agent.ts | 2 +- packages/network/test/unit/agent_spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/network/lib/agent.ts b/packages/network/lib/agent.ts index fb65a1b57e1f..425c3605be24 100644 --- a/packages/network/lib/agent.ts +++ b/packages/network/lib/agent.ts @@ -38,7 +38,7 @@ export function buildConnectReqHead (hostname: string, port: string, proxy: url. connectReq.push(`Host: ${hostname}:${port}`) if (proxy.auth) { - connectReq.push(`Proxy-Authorization: basic ${Buffer.from(proxy.auth).toString('base64')}`) + connectReq.push(`Proxy-Authorization: Basic ${Buffer.from(proxy.auth).toString('base64')}`) } return connectReq.join(CRLF) + _.repeat(CRLF, 2) diff --git a/packages/network/test/unit/agent_spec.ts b/packages/network/test/unit/agent_spec.ts index 46c451a68b75..b047a23eebca 100644 --- a/packages/network/test/unit/agent_spec.ts +++ b/packages/network/test/unit/agent_spec.ts @@ -608,7 +608,7 @@ describe('lib/agent', function () { expect(head).to.eq([ 'CONNECT foo.bar:1234 HTTP/1.1', 'Host: foo.bar:1234', - 'Proxy-Authorization: basic YmF6OnF1dXg=', + 'Proxy-Authorization: Basic YmF6OnF1dXg=', '', '', ].join('\r\n')) })