-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header generation refactoring #2436
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
…and there's no more duplication possible Signed-off-by: Amber <[email protected]>
…k methods Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
…mended that needs to be Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
📅 Suggested merge-by date: 3/5/2025 |
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2436 +/- ##
==========================================
- Coverage 91.50% 91.45% -0.06%
==========================================
Files 641 642 +1
Lines 18419 18423 +4
Branches 3963 3872 -91
==========================================
- Hits 16855 16848 -7
- Misses 1562 1573 +11
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
Signed-off-by: Amber <[email protected]>
|
This refactoring effort centralizes and standardizes header generation across the SDK and CLI, consolidating all header logic into a single utility class—ZosFilesHeaders—and replacing duplicate header creation code across multiple methods.
The new implementation leverages a unified
headerMap
to manage header generation functions, ensuring that headers like responseTimeout, etag, and others are applied consistently in all ZosFiles REST calls.Header Generation now:
options
dataLength
parameter to add a Content-Length header when needed.USS_MULTIPLE
: Forces a general content-type header ("Content-Type": "application/json") when multiple USS files.ZFS
&LIST
: No content-type headers are applied.UPLOAD
: Applies the content-type header ("X-IBM-Data-Type": encoding ). And will passContent-Type: application/octet-stream
for binary data.DOWNLOAD
: appliesContent-Type
header.Because of this centralization, organization, and newly provided clear definitions for expected headers, any future header changes or additions require modifications in only one location. Creating headers can now be done with a single function call, without much thought required in future development of the methods within ZosFiles SDK.