Fix cause error in case preview has data URI
This commit is contained in:
		
							parent
							
								
									d261fdbbc0
								
							
						
					
					
						commit
						f40e1ff0cc
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -14,7 +14,7 @@ module.exports = async (ctx: Koa.Context) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function wrap(url: string): string {
 | 
					function wrap(url: string): string {
 | 
				
			||||||
	return url != null
 | 
						return url != null
 | 
				
			||||||
		? url.startsWith('https://')
 | 
							? url.startsWith('https://') || url.startsWith('data:')
 | 
				
			||||||
			? url
 | 
								? url
 | 
				
			||||||
			: `https://images.weserv.nl/?url=${encodeURIComponent(url.replace(/^http:\/\//, ''))}`
 | 
								: `https://images.weserv.nl/?url=${encodeURIComponent(url.replace(/^http:\/\//, ''))}`
 | 
				
			||||||
		: null;
 | 
							: null;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue