fix unsafe methods

This commit is contained in:
Nazar Kanaev 2021-01-04 14:46:36 +00:00
parent 23a4ff3af6
commit 6a6153ca48

View File

@ -3,7 +3,7 @@
(function() {
var api = function(method, endpoint, data) {
var headers = {'Content-Type': 'application/json'}
if (['get', 'post', 'put'].indexOf(method) !== -1)
if (['post', 'put', 'delete'].indexOf(method) !== -1)
headers['x-requested-by'] = 'yarr'
return fetch(endpoint, {
method: method,