Comparing version 0.1.24 to 0.1.25
@@ -122,3 +122,7 @@ /** | ||
if (name.toLowerCase() == 'content-type') { | ||
this.http.sendContentType = true; | ||
if (value.toLowerCase().indexOf("charset=") === -1) { | ||
value += "; charset=" + C("encoding"); | ||
}; | ||
//Content-Type Header is Send | ||
this.http.cthIsSend = true; | ||
}; | ||
@@ -237,3 +241,5 @@ this.http.setHeader(name, value); | ||
json: function(data, jsonp){ | ||
this.header("Content-Type", C("json_content_type") + ";charset=" + C("encoding")); | ||
if (!this.http.cthIsSend) { | ||
this.header("Content-Type", C("json_content_type") + ";charset=" + C("encoding")); | ||
}; | ||
var callback = this.get(C("url_callback_name")); | ||
@@ -259,4 +265,4 @@ //过滤callback值里的非法字符 | ||
//自动发送Content-Type的header | ||
if (C('auto_send_content_type') && !this.http.sendContentType) { | ||
this.header("Content-Type", C("tpl_content_type") + ";charset=" + C("charset")); | ||
if (C('auto_send_content_type') && !this.http.cthIsSend) { | ||
this.header("Content-Type", C("tpl_content_type")); | ||
}; | ||
@@ -263,0 +269,0 @@ if (is_array(obj) || is_object(obj)) { |
@@ -65,9 +65,11 @@ /** | ||
render: function(content, charset, contentType){ | ||
if (charset === undefined) { | ||
charset = C('encoding'); | ||
if (!this.http.cthIsSend) { | ||
if (charset === undefined) { | ||
charset = C('encoding'); | ||
}; | ||
if (contentType === undefined) { | ||
contentType = C('tpl_content_type'); | ||
}; | ||
this.http.setHeader("Content-Type", contentType + "; charset=" + charset); | ||
}; | ||
if (contentType === undefined) { | ||
contentType = C('tpl_content_type'); | ||
}; | ||
this.http.setHeader("Content-Type", contentType + "; charset=" + charset); | ||
if (C('show_exec_time')) { | ||
@@ -74,0 +76,0 @@ this.http.sendTime("Exec-Time"); |
{ | ||
"name": "thinkjs", | ||
"description": "thinkphp web framework for nodejs", | ||
"version": "0.1.24", | ||
"version": "0.1.25", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "welefen", |
173488
5181