don't set contentType for empty body
When content-type is set to a non-standard value, CORS requires a preflight request that needs to be handled by the destination server. We shouldn't require that, when no body is sent at all and the content-type is irrelevant anyways.
This commit is contained in:
@@ -153,6 +153,9 @@ class OperationView extends Backbone.View
|
|||||||
if paramContentTypeField
|
if paramContentTypeField
|
||||||
obj.contentType = paramContentTypeField
|
obj.contentType = paramContentTypeField
|
||||||
|
|
||||||
|
if not obj.data
|
||||||
|
obj.contentType = false
|
||||||
|
|
||||||
responseContentTypeField = $('.content > .content-type > div > select[name=contentType]', $(@el)).val()
|
responseContentTypeField = $('.content > .content-type > div > select[name=contentType]', $(@el)).val()
|
||||||
if responseContentTypeField
|
if responseContentTypeField
|
||||||
obj.headers = if obj.headers? then obj.headers else {}
|
obj.headers = if obj.headers? then obj.headers else {}
|
||||||
|
|||||||
Reference in New Issue
Block a user