Describe the bug
I'm trying to create a basic request interceptor to set Authorization header. According to axios type definitions, I can use config.headers.setAuthorization method in my interceptor.


TypeScript compiles my source code correctly, but it fails to run, throwing a TypeError

To Reproduce
https://runkit.com/embed/70jjrl0otnq7
Code snippet
import axios from 'axios';
axios.interceptors.request.use((config) => {
config.headers.setAuthorization('Bearer 🐻');
return config;
});
await axios.get('https://www.google.com')
Expected behavior
I expect config.headers.setAuthorization() to correctly set Authorization http header for HTTP requests in runtime according to type definitions.
Axios Version
1.2.5
Adapter Version
HTTP
Browser
No response
Browser Version
No response
Node.js Version
18.13.0
OS
Fedora 37
Additional Library Versions
"@types/node": "^18.11.18"
"typescript": "^4.9.4"
Additional context/Screenshots
No response