mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	enhance: 許可されていないファイルタイプでは、オブジェクトストレージのファイル名に拡張子を付与しないように (#8108)
* 許可されていないファイルタイプでは、オブジェクトストレージのファイル名に拡張子を付与しないように * add comment
This commit is contained in:
		
							parent
							
								
									23efba6193
								
							
						
					
					
						commit
						333ba491f1
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -50,6 +50,12 @@ async function save(file: DriveFile, path: string, name: string, type: string, h
 | 
			
		|||
			if (type === 'image/vnd.mozilla.apng') ext = '.apng';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 拡張子からContent-Typeを設定してそうな挙動を示すオブジェクトストレージ (upcloud?) も存在するので、
 | 
			
		||||
		// 許可されているファイル形式でしか拡張子をつけない
 | 
			
		||||
		if (!FILE_TYPE_BROWSERSAFE.includes(type)) {
 | 
			
		||||
			ext = '';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		const baseUrl = meta.objectStorageBaseUrl
 | 
			
		||||
			|| `${ meta.objectStorageUseSSL ? 'https' : 'http' }://${ meta.objectStorageEndpoint }${ meta.objectStoragePort ? `:${meta.objectStoragePort}` : '' }/${ meta.objectStorageBucket }`;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue