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 {
80
80
if ( proxyUrl . username ) {
81
81
if ( proxyUrl . password ) {
82
82
log ( LogVerbosity . INFO , 'userinfo found in proxy URI' ) ;
83
- userCred = `${ proxyUrl . username } :${ proxyUrl . password } ` ;
83
+ userCred = decodeURIComponent ( `${ proxyUrl . username } :${ proxyUrl . password } ` ) ;
84
84
} else {
85
85
userCred = proxyUrl . username ;
86
86
}
@@ -233,6 +233,12 @@ export function getProxiedConnection(
233
233
' through proxy ' +
234
234
proxyAddressString
235
235
) ;
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
+ }
236
242
if ( 'secureContext' in connectionOptions ) {
237
243
/* The proxy is connecting to a TLS server, so upgrade this socket
238
244
* connection to a TLS connection.
You can’t perform that action at this time.
0 commit comments