Commit 5091592e authored by Romain Loth's avatar Romain Loth

fix default graph format if unspecified response header

parent 48104c44
......@@ -36,8 +36,17 @@ var AjaxSync = (function(TYPE, URL, DATA, CT , DT) {
async: false,
success : function(data, textStatus, jqXHR) {
header = jqXHR.getResponseHeader("Content-Type")
// console.log("AjaxSync("+URL+"):header="+header);
var format ;
if (!header || header == "application/octet-stream") {
// default choice if undetailed header
format = "gexf" ;
}
else {
format = "json" ;
}
header = (header)?"json":"gexf";
Result = { "OK":true , "format":header , "data":data };
Result = { "OK":true , "format":format , "data":data };
},
error: function(exception) {
Result = { "OK":false , "format":false , "data":exception.status };
......
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