Repository navigation
s3: Add missing port in signed hostname - #2222
Conversation
micafer
left a comment
There was a problem hiding this comment.
Thanks for the fix!
The change looks correct: non-default ports need to be included in the Host header used for AWS Signature V4 signing.
Could you please add a regression test for get_object_cdn_url() that verifies the host value passed to _get_signature()?
Ideally, the test should cover both HTTP and HTTPS, with default and non-default ports (80, 443, 9000, and 9443).
Since this change affects signature generation, having automated coverage would help prevent regressions.
Plase also add the entry in the CHANGES file.
Thanks! I didn't know how to test it, but looking at the arguments of Done
Done |
| PROJECT_ID_HEADER = "x-goog-project-id" | ||
|
|
||
| def __init__(self, user_id, key, secure=True, auth_type=None, credential_file=None, **kwargs): | ||
| def __init__(self, user_id, key, *args, auth_type=None, credential_file=None, **kwargs): |
There was a problem hiding this comment.
I had to change this to match its superclass, otherwise host would be passed as a positional arg and interpreted as auth_type.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2222 +/- ##
==========================================
+ Coverage 83.66% 83.67% +0.01%
==========================================
Files 352 352
Lines 82445 82487 +42
Branches 8890 8901 +11
==========================================
+ Hits 68974 69015 +41
- Misses 10591 10592 +1
Partials 2880 2880
🚀 New features to boost your workflow:
|
Removed unused import of pytest from test_s3.py
s3: Add missing port in signed hostname
Description
It is required when using a non-default port
Status
done
Checklist (tick everything that applies)