From 0173a9d89cb1aeeb35a6096651be5a2cc327e083 Mon Sep 17 00:00:00 2001 From: Peter Lyons Date: Mon, 15 May 2017 11:33:05 -0600 Subject: [PATCH] Fix xml tests that broke with mime update --- lib/client.js | 6 +++--- package.json | 2 +- test/basic.js | 2 +- test/request.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/client.js b/lib/client.js index 38809ffba..b0cda771d 100644 --- a/lib/client.js +++ b/lib/client.js @@ -169,7 +169,7 @@ request.parseString = parseString; request.types = { html: 'text/html', json: 'application/json', - xml: 'application/xml', + xml: 'text/xml', urlencoded: 'application/x-www-form-urlencoded', 'form': 'application/x-www-form-urlencoded', 'form-data': 'application/x-www-form-urlencoded' @@ -525,10 +525,10 @@ Request.prototype.auth = function(user, pass, options){ this.username = user; this.password = pass; break; - + case 'bearer': // usage would be .auth(accessToken, { type: 'bearer' }) this.set('Authorization', 'Bearer ' + user); - break; + break; } return this; }; diff --git a/package.json b/package.json index 1dbe7a917..ee1f1bd0f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "form-data": "^2.1.1", "formidable": "^1.1.1", "methods": "^1.1.1", - "mime": "^1.3.4", + "mime": "^1.3.6", "qs": "^6.4.0", "readable-stream": "^2.0.5" }, diff --git a/test/basic.js b/test/basic.js index 4c32fe037..3142f6fb3 100644 --- a/test/basic.js +++ b/test/basic.js @@ -360,7 +360,7 @@ describe('request', function(){ .accept('xml') .end(function(err, res){ try { - res.header['accept'].should.equal('application/xml'); + res.header['accept'].should.equal('text/xml'); done(); } catch(e) { done(e); } }); diff --git a/test/request.js b/test/request.js index 6f3a691aa..3cdbcf23d 100644 --- a/test/request.js +++ b/test/request.js @@ -295,7 +295,7 @@ it('request .accept() with xml', function(next){ .accept('xml') .end(function(err, res){ try { - assert.equal('application/xml', res.text, res.text); + assert.equal('text/xml', res.text, res.text); next(); } catch(e) { next(e); } });