feat: allow custom global options for $fetch.create#401
Merged
Conversation
$fetch.create
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #401 +/- ##
===========================================
+ Coverage 56.86% 67.22% +10.35%
===========================================
Files 16 16
Lines 728 476 -252
Branches 113 116 +3
===========================================
- Hits 414 320 -94
+ Misses 303 146 -157
+ Partials 11 10 -1 ☔ View full report in Codecov by Sentry. |
pi0
approved these changes
Aug 27, 2024
Member
pi0
left a comment
There was a problem hiding this comment.
LGTM. Although modifying standard globals should be last resort, there are legitimate usecases and it is better than patching actual globals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔗 Linked issue
#71
❓ Type of change
📚 Description
This commit adds an optional parameter
globalOptionsOverwriteto$fetch.create.However, for HTTP, headers are not case-sensitive. But for some reason, headers are case-sensitive in some old backend frameworks. This optional parameter overrides native
Headersbehaviour in such situations.As only adding an optional parameter, it won`t break anything, maybe?
📝 Checklist