fix(fileserver): use streaming for video/audio to prevent memory exhaustion
- Add serveMediaStream() to stream video/audio without loading into memory - Use http.ServeFile for local files (zero-copy, handles range requests) - Redirect to S3 presigned URLs for S3-stored media files - Refactor for better maintainability: - Extract constants and pre-compile lookup maps - Consolidate duplicated S3 client creation logic - Split authentication into focused helper methods - Group code by responsibility with section comments - Add setSecurityHeaders() and setMediaHeaders() helpers
Showing
This diff is collapsed.
Please register or sign in to comment