Skip to content

Commit bd7b388

Browse files
authored
fix(sandbox): remove double response relay in passthrough credential path (#610)
relay_passthrough_with_credentials called relay_http_request_with_resolver (which internally relays the upstream response back to the client) and then immediately called relay_response_to_client a second time. The second call blocked forever waiting for a response that would never arrive, deadlocking every CONNECT tunnel after its first request/response pair. This caused npm install (and any HTTP/1.1 keep-alive client) to hang indefinitely when routed through the sandbox proxy without L7 rules. The L7-inspection path (relay_rest) was not affected — it correctly makes a single call to relay_http_request_with_resolver.
1 parent 71d78c2 commit bd7b388

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

crates/openshell-sandbox/src/l7/relay.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,14 @@ where
275275
"HTTP_REQUEST",
276276
);
277277

278-
// Forward request with credential rewriting.
279-
let keep_alive =
278+
// Forward request with credential rewriting and relay the response.
279+
// relay_http_request_with_resolver handles both directions: it sends
280+
// the request upstream and reads the response back to the client.
281+
let reusable =
280282
crate::l7::rest::relay_http_request_with_resolver(&req, client, upstream, resolver)
281283
.await?;
282284

283-
// Relay response back to client.
284-
let reusable =
285-
crate::l7::rest::relay_response_to_client(upstream, client, &req.action).await?;
286-
287-
if !keep_alive || !reusable {
285+
if !reusable {
288286
break;
289287
}
290288
}

0 commit comments

Comments
 (0)