[Pkg-javascript-commits] [sockjs-client] 32/350: Add Content-Type request header for xhr send

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:03:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit f5db3362861362326b44341315f319084390eb7b
Author: Takeharu.Oshida <georgeosddev at gmail.com>
Date:   Tue May 6 07:12:06 2014 +0900

    Add Content-Type request header for xhr send
---
 lib/trans-sender.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/trans-sender.js b/lib/trans-sender.js
index da4639e..22762af 100644
--- a/lib/trans-sender.js
+++ b/lib/trans-sender.js
@@ -128,7 +128,9 @@ var jsonPGenericSender = function(url, payload, callback) {
 
 var createAjaxSender = function(AjaxObject) {
     return function(url, payload, callback) {
-        var xo = new AjaxObject('POST', url + '/xhr_send', payload);
+        var opt = {};
+        if (typeof payload === 'string') opt.headers = {'Content-type':'text/plain'};
+        var xo = new AjaxObject('POST', url + '/xhr_send', payload, opt);
         xo.onfinish = function(status, text) {
             callback(status === 200 || status === 204,
                      'http status ' + status);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list