No need to set content type for requests without body
This commit is contained in:
parent
a8fb681bfc
commit
ba2f691ae6
|
@ -23,12 +23,14 @@ jQuery.support.cors = true
|
||||||
options.url = "#{endpoint}#{url}"
|
options.url = "#{endpoint}#{url}"
|
||||||
options.type = method
|
options.type = method
|
||||||
options.dataType = options.dataType || 'json'
|
options.dataType = options.dataType || 'json'
|
||||||
options.contentType = options.contentType || 'application/json; charset=utf-8'
|
|
||||||
options.context = this
|
options.context = this
|
||||||
|
|
||||||
if options.data && method != 'GET'
|
if options.data && method != 'GET'
|
||||||
options.data = JSON.stringify(options.data)
|
options.data = JSON.stringify(options.data)
|
||||||
|
|
||||||
|
if method != 'GET' && method != 'HEAD'
|
||||||
|
options.contentType = options.contentType || 'application/json; charset=utf-8'
|
||||||
|
|
||||||
success = options.success || (->)
|
success = options.success || (->)
|
||||||
options.success = (data) =>
|
options.success = (data) =>
|
||||||
Travis.app.router.flashController.loadFlashes(data.flash) if Travis.app?.router && data.flash
|
Travis.app.router.flashController.loadFlashes(data.flash) if Travis.app?.router && data.flash
|
||||||
|
|
Loading…
Reference in New Issue
Block a user