GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — fix(headers): silently skip empty header names instead of throwing by rkdfx · Pull Request #10875 · axios/axios Conversation
|
| if (!key || (parsed[key] && ignoreDuplicateOf[key])) { | |
| return; | |
| } |
Closes #6959
lib/core/AxiosHeaders.js: replace the empty-name throw insetHeader with an early return.tests/unit/axiosHeaders.test.js: cover empty-name handling acrossindex.d.ts and index.d.cts)Silently skip empty or whitespace-only header names in AxiosHeaders.setHeader to prevent crashes when platforms emit empty keys (e.g., React Native 0.80+ on Android). Mirrors parseHeaders behavior and fixes #6959.
AxiosHeaders.setHeader with an early return (no-op).parseHeaders; applies to string keys, plain objects, and Map inputs./docs/ to note that empty or whitespace-only header names are ignored across string/object/Map inputs, matching parseHeaders.tests/unit/axiosHeaders.test.js covering empty and whitespace-only names for string, object, and Map inputs.Written for commit a63294d. Summary will update on new commits. Review in cubic
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
Confidence score: 5/5
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Two small suggestions are inline; both are non-blocking on their own but flag together. Nice fix overall: leaf-level placement is the right call, and the test matrix across string/object/Map is exactly what this needs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
merge please
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Signed-off-by: Ravi <[email protected]>
Signed-off-by: Ravi <[email protected]>
8e0546a to
17fadb0
Compare
There was an error while loading. Please reload this page.
…10875) * fix(headers): silently skip empty header names instead of throwing Signed-off-by: Ravi <[email protected]> * chore: add suggested test headers length assert Signed-off-by: Ravi <[email protected]> * test(headers): cover whitespace-only header names --------- Signed-off-by: Ravi <[email protected]> Co-authored-by: Jay <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[React Native 0.80.1]Header name must be a non-empty string on Android
There was an error while loading. Please reload this page.