Skip to content

Commit c94ee6e

Browse files
whummerpurcell
andauthored
Update utils/localstack_extensions/utils/docker.py
Co-authored-by: Steve Purcell <steve@sanityinc.com>
1 parent 902c003 commit c94ee6e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

utils/localstack_extensions/utils/docker.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,12 @@ def update_gateway_routes(self, router: http.Router[http.RouteHandler]):
133133
# Determine if HTTP proxy should be set up. Skip it when all container ports are
134134
# TCP-only and no host restriction is set, since a catch-all HTTP proxy would
135135
# intercept all requests and break other services.
136-
tcp_only = (
137-
self.tcp_ports
138-
and not self.host
139-
and set(self.container_ports) == set(self.tcp_ports)
136+
uses_http = (
137+
self.host
138+
and set(self.container_ports) - set(self.tcp_ports or [])
140139
)
141140

142-
if not tcp_only:
141+
if uses_http:
143142
# add resource for HTTP/1.1 requests
144143
resource = RuleAdapter(ProxyResource(self.container_host, self.main_port))
145144
if self.host:

0 commit comments

Comments
 (0)