mirror of
https://github.com/tenrok/axios.git
synced 2026-05-27 14:47:43 +03:00
fix(types): fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; (#5499)
This commit is contained in:
@@ -496,3 +496,14 @@ for (const [header, value] of headers) {
|
||||
(error: any) => Promise.reject(error)
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const config: axios.AxiosRequestConfig = {headers: new axios.AxiosHeaders({foo: 1})};
|
||||
|
||||
axios.get('', {
|
||||
headers: {
|
||||
bar: 2,
|
||||
...config.headers
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -616,3 +616,14 @@ for (const [header, value] of headers) {
|
||||
(error: any) => Promise.reject(error)
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const config: AxiosRequestConfig = {headers: new AxiosHeaders({foo: 1})};
|
||||
|
||||
axios.get('', {
|
||||
headers: {
|
||||
bar: 2,
|
||||
...config.headers
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user