File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def build_url(self, options: dict) -> str:
4646
4747 # if path is present then it is given priority over src parameter
4848 if path :
49- if transformation_position == "path" :
49+ if transformation_position == "path" and len ( transformation_str ) != 0 :
5050 temp_url = "{}/{}:{}/{}" .format (
5151 url_endpoint ,
5252 Default .TRANSFORMATION_PARAMETER .value ,
@@ -67,7 +67,7 @@ def build_url(self, options: dict) -> str:
6767
6868 query_params = dict (parse_qsl (url_object .query ))
6969 query_params .update (options .get ("query_parameters" , {}))
70- if transformation_position == Default .QUERY_TRANSFORMATION_POSITION .value :
70+ if transformation_position == Default .QUERY_TRANSFORMATION_POSITION .value and len ( transformation_str ) != 0 :
7171 query_params .update ({Default .TRANSFORMATION_PARAMETER .value : transformation_str })
7272 query_params .update ({Default .SDK_VERSION_PARAMETER .value : Default .SDK_VERSION .value })
7373
Original file line number Diff line number Diff line change @@ -488,3 +488,34 @@ def test_get_signature_without_expire_seconds_without_slash(self):
488488 signature = self .client .url_obj .get_signature (
489489 "private_key_test" , url , "https://test-domain.com/test-endpoint" , 0 )
490490 self .assertEqual (signature , "41b3075c40bc84147eb71b8b49ae7fbf349d0f00" )
491+
492+
493+ def test_generate_url_without_transforms (self ):
494+ options = {
495+ "path" : "/coffee.jpg" ,
496+ "signed" : False ,
497+ "expire_seconds" : 10
498+ }
499+
500+ url = self .client .url (options )
501+ self .assertEqual (
502+ url ,
503+ "https://test-domain.com/test-endpoint/coffee.jpg?ik-sdk-version={}" .format (
504+ Default .SDK_VERSION .value
505+ ),
506+ )
507+
508+ def test_generate_url_without_transforms_src (self ):
509+ options = {
510+ "src" : "https://test-domain.com/test-endpoint/coffee.jpg" ,
511+ "signed" : False ,
512+ "expire_seconds" : 10
513+ }
514+
515+ url = self .client .url (options )
516+ self .assertEqual (
517+ url ,
518+ "https://test-domain.com/test-endpoint/coffee.jpg?ik-sdk-version={}" .format (
519+ Default .SDK_VERSION .value
520+ ),
521+ )
You can’t perform that action at this time.
0 commit comments