mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
fix unsafe methods
This commit is contained in:
parent
23a4ff3af6
commit
6a6153ca48
@ -3,7 +3,7 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var api = function(method, endpoint, data) {
|
var api = function(method, endpoint, data) {
|
||||||
var headers = {'Content-Type': 'application/json'}
|
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'
|
headers['x-requested-by'] = 'yarr'
|
||||||
return fetch(endpoint, {
|
return fetch(endpoint, {
|
||||||
method: method,
|
method: method,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user