Commit 55381bcf authored by Alexey.Golubev's avatar Alexey.Golubev Committed by Alexander.Trofimov

Изменен Content-Type, иначе зависают запросы при проксировании через ARR с...

Изменен Content-Type, иначе зависают запросы при проксировании через ARR с Content-Type: application/x-www-form-urlencoded с использование ASP.NET 4.0.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60247 954022d7-b5bf-4e40-9824-e11837661b57
parent 0b348f1a
...@@ -37,7 +37,7 @@ function FileHandler() { ...@@ -37,7 +37,7 @@ function FileHandler() {
} }
var generateIFrameContent = function ( file ) { var generateIFrameContent = function ( file ) {
var frameWindow = window.frames["fileFrame"]; var frameWindow = window.frames["fileFrame"];
var content = "<form id='frmFile' method='post' enctype='application/data' action='" + file + "'></form>"; var content = "<form id='frmFile' method='post' enctype='multipart/form-data' action='" + file + "'></form>";
frameWindow.document.open(); frameWindow.document.open();
frameWindow.document.write( content ); frameWindow.document.write( content );
frameWindow.document.close(); frameWindow.document.close();
......
...@@ -770,12 +770,14 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -770,12 +770,14 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
spreadsheet_api.prototype._asc_sendCommand = function (callback, rdata) { spreadsheet_api.prototype._asc_sendCommand = function (callback, rdata) {
var sData; var sData;
var sRequestContentType = "application/json";
//json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception //json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception
if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked) if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked)
{ {
var sTemp = rdata["data"]; var sTemp = rdata["data"];
rdata["data"] = null; rdata["data"] = null;
sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp; sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp;
sRequestContentType = "application/octet-stream";
} }
else else
sData = JSON.stringify(rdata); sData = JSON.stringify(rdata);
...@@ -784,6 +786,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -784,6 +786,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
type: 'POST', type: 'POST',
url: g_sMainServiceLocalUrl, url: g_sMainServiceLocalUrl,
data: sData, data: sData,
contentType: sRequestContentType,
error: function(){ error: function(){
var result = {returnCode: c_oAscError.Level.Critical, val:c_oAscError.ID.Unknown}; var result = {returnCode: c_oAscError.Level.Critical, val:c_oAscError.ID.Unknown};
oThis.handlers.trigger("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.Critical); oThis.handlers.trigger("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.Critical);
...@@ -918,6 +921,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -918,6 +921,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
type: 'POST', type: 'POST',
url: url, url: url,
data: rdata, data: rdata,
contentType: "application/json",
error: function() { error: function() {
if (callback) if (callback)
callback({returnCode: c_oAscError.Level.Critical, val:c_oAscError.ID.Unknown}); callback({returnCode: c_oAscError.Level.Critical, val:c_oAscError.ID.Unknown});
...@@ -3545,6 +3549,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3545,6 +3549,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var url = "", type = "GET", var url = "", type = "GET",
async = true, data = null, dataType = "text/xml", async = true, data = null, dataType = "text/xml",
error = null, success = null, httpRequest = null, error = null, success = null, httpRequest = null,
contentType = "application/x-www-form-urlencoded",
init = function (obj){ init = function (obj){
...@@ -3569,6 +3574,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3569,6 +3574,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
if ( typeof obj.success !== 'undefined' ){ if ( typeof obj.success !== 'undefined' ){
success = obj.success; success = obj.success;
} }
if ( typeof (obj.contentType) !== 'undefined' ){
contentType = obj.contentType;
}
if (window.XMLHttpRequest) { // Mozilla, Safari, ... if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest(); httpRequest = new XMLHttpRequest();
...@@ -3597,7 +3605,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3597,7 +3605,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
send = function(){ send = function(){
httpRequest.open(type, url, async); httpRequest.open(type, url, async);
if (type === "POST") if (type === "POST")
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.setRequestHeader("Content-Type", contentType);
httpRequest.send(data); httpRequest.send(data);
}, },
......
...@@ -4895,12 +4895,14 @@ function getURLParameter(name) { ...@@ -4895,12 +4895,14 @@ function getURLParameter(name) {
} }
function sendCommand(editor, fCallback, rdata){ function sendCommand(editor, fCallback, rdata){
var sData; var sData;
var sRequestContentType = "application/json";
//json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception //json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception
if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked) if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked)
{ {
var sTemp = rdata["data"]; var sTemp = rdata["data"];
rdata["data"] = null; rdata["data"] = null;
sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp; sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp;
sRequestContentType = "application/octet-stream";
} }
else else
sData = JSON.stringify(rdata); sData = JSON.stringify(rdata);
...@@ -4908,6 +4910,7 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -4908,6 +4910,7 @@ function sendCommand(editor, fCallback, rdata){
type: 'POST', type: 'POST',
url: g_sMainServiceLocalUrl, url: g_sMainServiceLocalUrl,
data: sData, data: sData,
contentType: sRequestContentType,
error: function(){ error: function(){
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical); editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback) if(fCallback)
...@@ -4989,6 +4992,7 @@ function sendTrack(fCallback, url, rdata){ ...@@ -4989,6 +4992,7 @@ function sendTrack(fCallback, url, rdata){
type: 'POST', type: 'POST',
url: url, url: url,
data: rdata, data: rdata,
contentType: "application/json",
error: function(){ error: function(){
if(fCallback) if(fCallback)
fCallback(); fCallback();
...@@ -5131,6 +5135,7 @@ function asc_ajax(obj){ ...@@ -5131,6 +5135,7 @@ function asc_ajax(obj){
var url = "", type = "GET", var url = "", type = "GET",
async = true, data = null, dataType = "text/xml", async = true, data = null, dataType = "text/xml",
error = null, success = null, httpRequest = null, error = null, success = null, httpRequest = null,
contentType = "application/x-www-form-urlencoded",
init = function (obj){ init = function (obj){
...@@ -5155,6 +5160,9 @@ function asc_ajax(obj){ ...@@ -5155,6 +5160,9 @@ function asc_ajax(obj){
if ( typeof (obj.success) != 'undefined' ){ if ( typeof (obj.success) != 'undefined' ){
success = obj.success; success = obj.success;
} }
if ( typeof (obj.contentType) != 'undefined' ){
contentType = obj.contentType;
}
if (window.XMLHttpRequest) { // Mozilla, Safari, ... if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest(); httpRequest = new XMLHttpRequest();
...@@ -5183,7 +5191,7 @@ function asc_ajax(obj){ ...@@ -5183,7 +5191,7 @@ function asc_ajax(obj){
send = function(){ send = function(){
httpRequest.open(type, url, async); httpRequest.open(type, url, async);
if (type === "POST") if (type === "POST")
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.setRequestHeader("Content-Type", contentType);
httpRequest.send(data); httpRequest.send(data);
}, },
......
...@@ -7310,12 +7310,14 @@ function _onSpellCheck_Callback2 (response) ...@@ -7310,12 +7310,14 @@ function _onSpellCheck_Callback2 (response)
};*/ };*/
function sendCommand(editor, fCallback, rdata){ function sendCommand(editor, fCallback, rdata){
var sData; var sData;
var sRequestContentType = "application/json";
//json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception //json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception
if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked) if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked)
{ {
var sTemp = rdata["data"]; var sTemp = rdata["data"];
rdata["data"] = null; rdata["data"] = null;
sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp; sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp;
sRequestContentType = "application/octet-stream";
} }
else else
sData = JSON.stringify(rdata); sData = JSON.stringify(rdata);
...@@ -7323,6 +7325,7 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -7323,6 +7325,7 @@ function sendCommand(editor, fCallback, rdata){
type: 'POST', type: 'POST',
url: g_sMainServiceLocalUrl, url: g_sMainServiceLocalUrl,
data: sData, data: sData,
contentType: sRequestContentType,
error: function(){ error: function(){
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical); editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback) if(fCallback)
...@@ -7422,6 +7425,7 @@ function sendTrack(fCallback, url, rdata){ ...@@ -7422,6 +7425,7 @@ function sendTrack(fCallback, url, rdata){
type: 'POST', type: 'POST',
url: url, url: url,
data: rdata, data: rdata,
contentType: "application/json",
error: function(){ error: function(){
if(fCallback) if(fCallback)
fCallback(); fCallback();
...@@ -7572,6 +7576,7 @@ function asc_ajax(obj){ ...@@ -7572,6 +7576,7 @@ function asc_ajax(obj){
var url = "", type = "GET", var url = "", type = "GET",
async = true, data = null, dataType = "text/xml", async = true, data = null, dataType = "text/xml",
error = null, success = null, httpRequest = null, error = null, success = null, httpRequest = null,
contentType = "application/x-www-form-urlencoded",
init = function (obj){ init = function (obj){
...@@ -7596,6 +7601,9 @@ function asc_ajax(obj){ ...@@ -7596,6 +7601,9 @@ function asc_ajax(obj){
if ( typeof (obj.success) != 'undefined' ){ if ( typeof (obj.success) != 'undefined' ){
success = obj.success; success = obj.success;
} }
if ( typeof (obj.contentType) != 'undefined' ){
contentType = obj.contentType;
}
if (window.XMLHttpRequest) { // Mozilla, Safari, ... if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest(); httpRequest = new XMLHttpRequest();
...@@ -7624,7 +7632,7 @@ function asc_ajax(obj){ ...@@ -7624,7 +7632,7 @@ function asc_ajax(obj){
send = function(){ send = function(){
httpRequest.open(type, url, async); httpRequest.open(type, url, async);
if (type === "POST") if (type === "POST")
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.setRequestHeader("Content-Type", contentType);
httpRequest.send(data); httpRequest.send(data);
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment