Skip to content

Commit 03fa045

Browse files
author
Saurav Tiwary
committed
use rstrip to conditionally remove trailing slash in netloc
Signed-off-by: Saurav Tiwary <[email protected]>
1 parent 16cf0b6 commit 03fa045

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imagekitio/url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def build_url(self, options: dict) -> str:
114114
expiry_timestamp = self.get_signature_timestamp(expire_seconds)
115115

116116
# remove the trailing slash('/') from the netloc since `urlunparse` adds it
117-
result_url_dict['netloc'] = result_url_dict['netloc'][:-1]
117+
result_url_dict["netloc"].rstrip("/")
118118
intermediate_url = urlunparse(
119119
result_url_dict.get(f, "") for f in ParseResult._fields
120120
)

0 commit comments

Comments
 (0)