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

Making content-type header case insensitive

closes #89
This commit is contained in:
mzabriskie
2015-07-23 09:39:59 -07:00
parent 3b10b6a6c5
commit 3c4dfe8a81
2 changed files with 33 additions and 2 deletions
+23
View File
@@ -56,6 +56,29 @@ describe('requests', function () {
}, 0);
});
it('should allow overriding Content-Type header case-insensitive', function (done) {
var request, response;
var contentType = 'application/vnd.myapp.type+json';
axios({
url: '/foo',
method: 'post',
data: { prop: 'value' },
headers: {
'content-type': contentType
}
}).then(function (res) {
response = res;
});
setTimeout(function () {
request = jasmine.Ajax.requests.mostRecent();
expect(request.requestHeaders['Content-Type']).toEqual(contentType);
done();
});
});
it('should support binary data as array buffer', function (done) {
var request;
var input = new Int8Array(2);