Skip to content

Commit 2d9d625

Browse files
whummerpurcell
andcommitted
Update utils/localstack_extensions/utils/docker.py
Co-authored-by: Steve Purcell <steve@sanityinc.com>
1 parent 70695e6 commit 2d9d625

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
@@ -138,13 +138,12 @@ def update_gateway_routes(self, router: http.Router[http.RouteHandler]):
138138
# Determine if HTTP proxy should be set up. Skip it when all container ports are
139139
# TCP-only and no host restriction is set, since a catch-all HTTP proxy would
140140
# intercept all requests and break other services.
141-
tcp_only = (
142-
self.tcp_ports
143-
and not self.host
144-
and set(self.container_ports) == set(self.tcp_ports)
141+
uses_http = (
142+
self.host
143+
and set(self.container_ports) - set(self.tcp_ports or [])
145144
)
146145

147-
if not tcp_only:
146+
if uses_http:
148147
# add resource for HTTP/1.1 requests
149148
resource = RuleAdapter(ProxyResource(self.container_host, self.main_port))
150149
if self.host:

0 commit comments

Comments
 (0)