diff --git a/LICENSE b/LICENSE index 6b55ca9..c7237a6 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/pyimgproxy/image.py b/pyimgproxy/image.py index 2cfa10d..b35ca04 100644 --- a/pyimgproxy/image.py +++ b/pyimgproxy/image.py @@ -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, @@ -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}" diff --git a/tests/test_image.py b/tests/test_image.py index cc60d89..8c88efa 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -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", )