File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function getProxyInfo(): ProxyInfo {
8080 if ( proxyUrl . username ) {
8181 if ( proxyUrl . password ) {
8282 log ( LogVerbosity . INFO , 'userinfo found in proxy URI' ) ;
83- userCred = `${ proxyUrl . username } :${ proxyUrl . password } ` ;
83+ userCred = decodeURIComponent ( `${ proxyUrl . username } :${ proxyUrl . password } ` ) ;
8484 } else {
8585 userCred = proxyUrl . username ;
8686 }
@@ -233,6 +233,12 @@ export function getProxiedConnection(
233233 ' through proxy ' +
234234 proxyAddressString
235235 ) ;
236+ // The HTTP client may have already read a few bytes of the proxied
237+ // connection. If that's the case, put them back into the socket.
238+ // See https://github.com/grpc/grpc-node/issues/2744.
239+ if ( head . length > 0 ) {
240+ socket . unshift ( head ) ;
241+ }
236242 if ( 'secureContext' in connectionOptions ) {
237243 /* The proxy is connecting to a TLS server, so upgrade this socket
238244 * connection to a TLS connection.
You can’t perform that action at this time.
0 commit comments