Skip to content

Commit

Permalink
Merge pull request Zemistr#1 from lkadlec/master
Browse files Browse the repository at this point in the history
Remove unsafe header "Connection"
Changed successful code from 200 to 2xx
  • Loading branch information
Zemistr committed Apr 29, 2016
2 parents 7cb5e7d + d95a86e commit d980572
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/l10nNetteTranslator/Templates/panel.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
var request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
request.onreadystatechange = function () {
if (request.readyState == 4) {
if (request.status == 200) {
if (request.status.toString().match(/2\d\d/)) {
var response = JSON.parse(request.responseText), key;

if (response.hasOwnProperty('message') && response.message) {
Expand All @@ -232,7 +232,6 @@
request.open("POST", '', true);
request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
request.setRequestHeader('Connection', 'close');
request.send(this.buildParams({'<?= l10nNetteTranslator\TranslatorProcessor::PARAMETER ?>': data}));
},
getById: function (id) {
Expand Down

0 comments on commit d980572

Please sign in to comment.