(js) Use GET instead of POST when form is empty

Fixes #3978, #3979
This commit is contained in:
Francis Lachapelle
2017-01-06 11:38:10 -05:00
parent 278b65d89c
commit d548cea518

View File

@@ -1,3 +1,5 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; js-indent-level: 4; -*- */
/* generic.js - this file is part of SOGo
Copyright (C) 2006-2014 Inverse
@@ -460,12 +462,13 @@ function getContrastingTextColor(bgColor) {
}
function triggerAjaxRequest(url, callback, userdata, content, headers, attempt) {
var http = createHTTPClient();
var http = createHTTPClient(),
method = (content? 'POST' : 'GET');
if (http) {
activeAjaxRequests++;
document.animTimer = setTimeout("checkAjaxRequestsState();", 250);
http.open("POST", url, true);
http.open(method, url, true);
http.url = url;
http.paramHeaders = headers;
http.content = content;