From 26d2dfa4d8a02c984ed9ccc199051daba1ac66c4 Mon Sep 17 00:00:00 2001 From: Kerrick Long Date: Wed, 1 May 2019 13:27:01 -0500 Subject: [PATCH] Allow `undefined` for dataType option This change allows users of `ember-ajax` to opt into jQuery's "intelligent guess" based on the response's Content-Type headers. --- addon/mixins/ajax-request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/mixins/ajax-request.ts b/addon/mixins/ajax-request.ts index 245ea11a..29c0a3a9 100644 --- a/addon/mixins/ajax-request.ts +++ b/addon/mixins/ajax-request.ts @@ -445,7 +445,7 @@ export default Mixin.create({ options = assign({}, options); options.url = this._buildURL(url, options); options.type = options.type || 'GET'; - options.dataType = options.dataType || 'json'; + options.dataType = options.hasOwnProperty('dataType') ? options.dataType : 'json'; options.contentType = isEmpty(options.contentType) ? get(this, 'contentType') : options.contentType;