when method is GET and TRACE, useBody becomes always false

This commit is contained in:
Yoshiki Shibukawa 2017-02-19 22:00:30 +09:00
parent 1a6554423d
commit b86805ada3

View file

@ -43,7 +43,7 @@ module.exports = function($window, Promise) {
if (args.method == null) args.method = "GET"
args.method = args.method.toUpperCase()
var useBody = typeof args.useBody === "boolean" ? args.useBody : args.method !== "GET" && args.method !== "TRACE"
var useBody = (args.method === "GET" || args.method === "TRACE") ? false : (typeof args.useBody === "boolean" ? args.useBody : true)
if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify
if (typeof args.deserialize !== "function") args.deserialize = deserialize