diff options
author | Jason <jason.daurus@gmail.com> | 2016-06-18 14:18:24 +0800 |
---|---|---|
committer | Jason <jason.daurus@gmail.com> | 2016-06-18 14:18:24 +0800 |
commit | 9cb5b0af9db83d84af0bdb45d56a9755b400c212 (patch) | |
tree | a2f2c6985f8a2230be3b8796567e678733e03b7f /web/src/js/utils.js | |
parent | 6c0511b06fdc359ec4c48879f803c80d7fbeb34c (diff) | |
parent | 23b976a999f41439e83c1010474ec9dc680b8486 (diff) | |
download | mitmproxy-9cb5b0af9db83d84af0bdb45d56a9755b400c212.tar.gz mitmproxy-9cb5b0af9db83d84af0bdb45d56a9755b400c212.tar.bz2 mitmproxy-9cb5b0af9db83d84af0bdb45d56a9755b400c212.zip |
Merge branch 'master' of github.com:mitmproxy/mitmproxy into websocket
Conflicts:
mitmproxy/web/static/app.js
web/src/js/components/ProxyApp.jsx
web/src/js/connection.js
Diffstat (limited to 'web/src/js/utils.js')
-rw-r--r-- | web/src/js/utils.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/web/src/js/utils.js b/web/src/js/utils.js index 2e5c3005..2e25016e 100644 --- a/web/src/js/utils.js +++ b/web/src/js/utils.js @@ -109,7 +109,19 @@ export function fetchApi(url, options) { url += "&" + xsrf; } return fetch(url, { - ...options, - credentials: 'same-origin' + credentials: 'same-origin', + ...options }); -}
\ No newline at end of file +} + +fetchApi.put = (url, json, options) => fetchApi( + url, + { + method: "PUT", + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(json), + ...options + } +) |