mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	merge: Fix Content-Length resetting for partial content length requests (!796)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/796 Closes #824 Approved-by: Hazelnoot <acomputerdog@gmail.com> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
		
						commit
						f59af78d8a
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -192,6 +192,9 @@ export class FileServerService {
 | 
			
		|||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				// set Content-Length before we chunk, so it can properly override when chunking.
 | 
			
		||||
				reply.header('Content-Length', file.file.size);
 | 
			
		||||
 | 
			
		||||
				if (!image) {
 | 
			
		||||
					if (request.headers.range && file.file.size > 0) {
 | 
			
		||||
						const range = request.headers.range as string;
 | 
			
		||||
| 
						 | 
				
			
			@ -235,7 +238,6 @@ export class FileServerService {
 | 
			
		|||
				}
 | 
			
		||||
 | 
			
		||||
				reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(image.type) ? image.type : 'application/octet-stream');
 | 
			
		||||
				reply.header('Content-Length', file.file.size);
 | 
			
		||||
				reply.header('Cache-Control', 'max-age=31536000, immutable');
 | 
			
		||||
				reply.header('Content-Disposition',
 | 
			
		||||
					contentDisposition(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue