parent
							
								
									c1deb9438d
								
							
						
					
					
						commit
						94f2c20d35
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -101,7 +101,11 @@ async function detectMine(path: string) {
 | 
				
			||||||
				readable.destroy();
 | 
									readable.destroy();
 | 
				
			||||||
				const type = fileType(buffer);
 | 
									const type = fileType(buffer);
 | 
				
			||||||
				if (type) {
 | 
									if (type) {
 | 
				
			||||||
					res([type.mime, type.ext]);
 | 
										if (type.mime == 'application/xml' && checkSvg(path)) {
 | 
				
			||||||
 | 
											res(['image/svg+xml', 'svg']);
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											res([type.mime, type.ext]);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
				} else if (checkSvg(path)) {
 | 
									} else if (checkSvg(path)) {
 | 
				
			||||||
					res(['image/svg+xml', 'svg']);
 | 
										res(['image/svg+xml', 'svg']);
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -310,7 +310,11 @@ export default async function(
 | 
				
			||||||
				readable.destroy();
 | 
									readable.destroy();
 | 
				
			||||||
				const type = fileType(buffer);
 | 
									const type = fileType(buffer);
 | 
				
			||||||
				if (type) {
 | 
									if (type) {
 | 
				
			||||||
					res([type.mime, type.ext]);
 | 
										if (type.mime == 'application/xml' && checkSvg(path)) {
 | 
				
			||||||
 | 
											res(['image/svg+xml', 'svg']);
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											res([type.mime, type.ext]);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
				} else if (checkSvg(path)) {
 | 
									} else if (checkSvg(path)) {
 | 
				
			||||||
					res(['image/svg+xml', 'svg']);
 | 
										res(['image/svg+xml', 'svg']);
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue