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() {
}
var generateIFrameContent = function ( file ) {
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.write( content );
frameWindow.document.close();
......
......@@ -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) {
var sData;
var sRequestContentType = "application/json";
//json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception
if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked)
{
var sTemp = rdata["data"];
rdata["data"] = null;
sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp;
sRequestContentType = "application/octet-stream";
}
else
sData = JSON.stringify(rdata);
......@@ -784,6 +786,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
type: 'POST',
url: g_sMainServiceLocalUrl,
data: sData,
contentType: sRequestContentType,
error: function(){
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);
......@@ -918,6 +921,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
type: 'POST',
url: url,
data: rdata,
contentType: "application/json",
error: function() {
if (callback)
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";
var url = "", type = "GET",
async = true, data = null, dataType = "text/xml",
error = null, success = null, httpRequest = null,
contentType = "application/x-www-form-urlencoded",
init = function (obj){
......@@ -3569,6 +3574,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
if ( typeof obj.success !== 'undefined' ){
success = obj.success;
}
if ( typeof (obj.contentType) !== 'undefined' ){
contentType = obj.contentType;
}
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest();
......@@ -3597,7 +3605,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
send = function(){
httpRequest.open(type, url, async);
if (type === "POST")
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
httpRequest.setRequestHeader("Content-Type", contentType);
httpRequest.send(data);
},
......
......@@ -4895,12 +4895,14 @@ function getURLParameter(name) {
}
function sendCommand(editor, fCallback, rdata){
var sData;
var sRequestContentType = "application/json";
//json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception
if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked)
{
var sTemp = rdata["data"];
rdata["data"] = null;
sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp;
sRequestContentType = "application/octet-stream";
}
else
sData = JSON.stringify(rdata);
......@@ -4908,6 +4910,7 @@ function sendCommand(editor, fCallback, rdata){
type: 'POST',
url: g_sMainServiceLocalUrl,
data: sData,
contentType: sRequestContentType,
error: function(){
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback)
......@@ -4989,6 +4992,7 @@ function sendTrack(fCallback, url, rdata){
type: 'POST',
url: url,
data: rdata,
contentType: "application/json",
error: function(){
if(fCallback)
fCallback();
......@@ -5131,6 +5135,7 @@ function asc_ajax(obj){
var url = "", type = "GET",
async = true, data = null, dataType = "text/xml",
error = null, success = null, httpRequest = null,
contentType = "application/x-www-form-urlencoded",
init = function (obj){
......@@ -5155,6 +5160,9 @@ function asc_ajax(obj){
if ( typeof (obj.success) != 'undefined' ){
success = obj.success;
}
if ( typeof (obj.contentType) != 'undefined' ){
contentType = obj.contentType;
}
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest();
......@@ -5183,7 +5191,7 @@ function asc_ajax(obj){
send = function(){
httpRequest.open(type, url, async);
if (type === "POST")
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
httpRequest.setRequestHeader("Content-Type", contentType);
httpRequest.send(data);
},
......
......@@ -7310,12 +7310,14 @@ function _onSpellCheck_Callback2 (response)
};*/
function sendCommand(editor, fCallback, rdata){
var sData;
var sRequestContentType = "application/json";
//json не должен превышать размера g_nMaxJsonLength, иначе при его чтении будет exception
if(null != rdata["data"] && "string" === typeof(rdata["data"]) && rdata["data"].length > g_nMaxJsonLengthChecked)
{
var sTemp = rdata["data"];
rdata["data"] = null;
sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(rdata) + cCharDelimiter + sTemp;
sRequestContentType = "application/octet-stream";
}
else
sData = JSON.stringify(rdata);
......@@ -7323,6 +7325,7 @@ function sendCommand(editor, fCallback, rdata){
type: 'POST',
url: g_sMainServiceLocalUrl,
data: sData,
contentType: sRequestContentType,
error: function(){
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback)
......@@ -7422,6 +7425,7 @@ function sendTrack(fCallback, url, rdata){
type: 'POST',
url: url,
data: rdata,
contentType: "application/json",
error: function(){
if(fCallback)
fCallback();
......@@ -7572,6 +7576,7 @@ function asc_ajax(obj){
var url = "", type = "GET",
async = true, data = null, dataType = "text/xml",
error = null, success = null, httpRequest = null,
contentType = "application/x-www-form-urlencoded",
init = function (obj){
......@@ -7596,6 +7601,9 @@ function asc_ajax(obj){
if ( typeof (obj.success) != 'undefined' ){
success = obj.success;
}
if ( typeof (obj.contentType) != 'undefined' ){
contentType = obj.contentType;
}
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest();
......@@ -7624,7 +7632,7 @@ function asc_ajax(obj){
send = function(){
httpRequest.open(type, url, async);
if (type === "POST")
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
httpRequest.setRequestHeader("Content-Type", contentType);
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