Skip to content

Commit a3897ef

Browse files
committed
Strip '/' from path prefix once per server, not once per request
1 parent be8d1fa commit a3897ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crate/client/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def __init__(self, server, **pool_kw):
154154
)
155155
)
156156
if parsed_url.path:
157-
self.path_prefix = parsed_url.path
157+
self.path_prefix = parsed_url.path.strip("/")
158158
self.pool = connection_from_url(
159159
server,
160160
socket_options=socket_options,
@@ -180,7 +180,7 @@ def request(
180180
"""
181181
if self.path_prefix:
182182
path = "/{path_prefix}/{path}".format(
183-
path_prefix=self.path_prefix.strip("/"), path=path.strip("/")
183+
path_prefix=self.path_prefix, path=path.strip("/")
184184
)
185185
if headers is None:
186186
headers = {}

0 commit comments

Comments
 (0)