You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The judgment of "value !== false" inside the toJSON method of the AxiosHeaders class, is it necessary? If I add a header with a value of false, it will be automatically deleted. Is this reasonable?
Yes, the false value is taken into account by the set method and its rewrite option in the AxiosHeader API. Therefore, such a value will not be overwritten unless the rewrite option is explicitly specified in the method. Axios logic relies on this to allow the user to opt out of installing unwanted and/or default headers.
Describe the bug
The judgment of "value !== false" inside the toJSON method of the AxiosHeaders class, is it necessary? If I add a header with a value of false, it will be automatically deleted. Is this reasonable?
To Reproduce
No response
Code snippet
Expected behavior
Remove the judgment of "value !== false".
Axios Version
1.x
Adapter Version
xhr
Browser
Chrome
Browser Version
112.0.5615.138
Node.js Version
16.20.0
OS
Win 11
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: