From 6da5a6085726f4a21bf11421519223ea111eb1eb Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Tue, 5 May 2015 12:35:02 +0100 Subject: [PATCH] safer writing of content-type header --- src/poller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/poller.js b/src/poller.js index d955309..03cb0ae 100644 --- a/src/poller.js +++ b/src/poller.js @@ -17,8 +17,10 @@ var Poller = function(config) { this.options.headers = this.options.headers || {}; - if (!this.options.headers.Accept) { + if (!this.options.headers['Content-Type']) { this.options.headers['Content-Type'] = 'application/json'; + } + if (!this.options.headers.Accept) { this.options.headers['Accept'] = 'application/json'; }