Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2024, Developer Society Limited
Copyright (c) 2024-2025, Developer Society Limited
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions pyimgproxy/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def url(self) -> str:
else:
image_path = f"/plain/{self._source_url}".encode()

if self.imgproxy.key and self.imgproxy.salt and True:
if self.imgproxy.key and self.imgproxy.salt:
unsigned_path = options_path_bytes + image_path
digest = hmac.new(
key=self.imgproxy.key,
Expand All @@ -747,6 +747,6 @@ def url(self) -> str:
full_path = (b"/" + signature + unsigned_path).decode()
else:
# No signature checking - the signature part may contain anything
full_path = (options_path_bytes + image_path).decode()
full_path = (b"/_" + options_path_bytes + image_path).decode()

return f"{self.imgproxy.url}{full_path}"
2 changes: 1 addition & 1 deletion tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,5 @@ def test_url_no_key_or_salt(self):

self.assertEqual(
image.url,
"https://example.org/thumbnail/size:640:480/plain/demo.png",
"https://example.org/thumbnail/_/size:640:480/plain/demo.png",
)