2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

fix(headers): allow iterable objects to be a data source for the set method; (#6873)

This commit is contained in:
Dmitriy Mozgovoy
2025-04-14 21:55:27 +03:00
committed by GitHub
parent 47a611f084
commit 1b1f9ccdc1
3 changed files with 27 additions and 10 deletions
+9 -1
View File
@@ -73,7 +73,15 @@ describe('AxiosHeaders', function () {
headers.set('foo', 'value2', true);
assert.strictEqual(headers.get('foo'), 'value2');
})
});
it('should support iterables as a key-value source object', function () {
const headers = new AxiosHeaders();
headers.set(new Map([['x', '123']]));
assert.strictEqual(headers.get('x'), '123');
});
});
it('should support uppercase name mapping for names overlapped by class methods', () => {