提交 767690c0 编写于 作者: K Kevan Stannard

Explicitly set the SVG MIME type (to fix loading SVGs as textures)

上级 1645d319
......@@ -184,13 +184,12 @@ Object.assign( FileLoader.prototype, {
if ( this.responseType !== undefined ) request.responseType = this.responseType;
if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
if ( ! this.mimeType && this.responseType !== 'blob' ) {
// Setting 'text/plain' as the MIME type for SVG files will cause a
// problem when the ImageLoader tries to use it as the src of an image,
// so explicitly set the SVG MIME type.
if ( /\.svg$/.test( url ) ) this.mimeType = 'image/svg+xml';
this.setMimeType( 'text/plain' );
}
if ( this.mimeType && request.overrideMimeType ) request.overrideMimeType( this.mimeType );
if ( request.overrideMimeType ) request.overrideMimeType( this.mimeType !== undefined ? this.mimeType : 'text/plain' );
request.send( null );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册