diff options
| -rw-r--r-- | ext/bg/js/ankiweb.js | 11 | 
1 files changed, 8 insertions, 3 deletions
| diff --git a/ext/bg/js/ankiweb.js b/ext/bg/js/ankiweb.js index dc6a5d49..6a45b9c5 100644 --- a/ext/bg/js/ankiweb.js +++ b/ext/bg/js/ankiweb.js @@ -155,9 +155,14 @@ class AnkiWeb {              const xhr = new XMLHttpRequest();              xhr.addEventListener('error', () => reject('failed to execute network request'));              xhr.addEventListener('load', () => resolve(xhr.responseText)); -            xhr.open('POST', url); -            xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); -            xhr.send(dataEnc); +            if (dataEnc) { +                xhr.open('POST', url); +                xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); +                xhr.send(dataEnc); +            } else { +                xhr.open('GET', url); +                xhr.send(); +            }          });      }  } |