From 0d47a62f8df511929057023f3884dbad1d4ebfba Mon Sep 17 00:00:00 2001 From: Takahiro Date: Tue, 1 Nov 2016 17:42:28 -0700 Subject: [PATCH] Add setOverrideMimeType() to XHRLoader (#9959) * Add setOverrideMimeType() to XHRLoader * Rename setOverrideMimeType with setMimeType of FileLoader --- src/loaders/FileLoader.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/loaders/FileLoader.js b/src/loaders/FileLoader.js index 32e7de42f9f784..2fb06a8301e0ac 100644 --- a/src/loaders/FileLoader.js +++ b/src/loaders/FileLoader.js @@ -184,7 +184,7 @@ Object.assign( FileLoader.prototype, { if ( this.responseType !== undefined ) request.responseType = this.responseType; if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials; - if ( request.overrideMimeType ) request.overrideMimeType( 'text/plain' ); + if ( request.overrideMimeType ) request.overrideMimeType( this.mimeType !== undefined ? this.mimeType : 'text/plain' ); request.send( null ); @@ -215,6 +215,13 @@ Object.assign( FileLoader.prototype, { this.withCredentials = value; return this; + }, + + setMimeType: function ( value ) { + + this.mimeType = value; + return this; + } } );