|
@@ -59,7 +59,7 @@ function sendSyncRequest(url, method, data) {
|
|
const xhr = new XMLHttpRequest();
|
|
const xhr = new XMLHttpRequest();
|
|
xhr.open(method, url, false);
|
|
xhr.open(method, url, false);
|
|
|
|
|
|
- if (method === 'POST' || method === 'PUT') {
|
|
|
|
|
|
+ if (method.match(/^(POST|PUT)$/i)) {
|
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
xhr.send(JSON.stringify(data));
|
|
xhr.send(JSON.stringify(data));
|
|
} else {
|
|
} else {
|