Fix NewHTTP to use the provided client parameter instead of always us… #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix HTTP client parameter bug and improve disk storage consistency
Description
This PR fixes two bugs found in the codebase:
HTTP Storage Client Bug: The
NewHTTPfunction ininternal/infra/storage/http.gowas ignoring theclientparameter and always usinghttp.DefaultClient. This prevented users from configuring custom HTTP clients with specific timeouts or transport settings.Disk Storage Consistency Issue: The
writeMetafunction ininternal/infra/storage/disk.gowas usingO_TRUNCflag instead ofO_EXCL, which made it inconsistent withwriteFileand prevented theretryOnExisthelper from working correctly for metadata files.Changes
internal/infra/storage/http.go: Changed line 21 to use the providedclientparameter instead ofhttp.DefaultClientinternal/infra/storage/disk.go: Changed line 338 to useO_EXCLflag instead ofO_TRUNCfor consistencyImpact
TODOs
Read the Contribution guidelines.
Release Notes (draft)
Fixed HTTP client parameter being ignored in
NewHTTPfunction and improved disk storage consistency by usingO_EXCLflag inwriteMeta.Migration Guide
No migration needed - these are bug fixes with no API changes.