Skip to content

[ticket/17447] Add http range requests to attachments downloads#6766

Merged
marc1706 merged 2 commits intophpbb:masterfrom
rubencm:ticket/17447
Mar 28, 2026
Merged

[ticket/17447] Add http range requests to attachments downloads#6766
marc1706 merged 2 commits intophpbb:masterfrom
rubencm:ticket/17447

Conversation

@rubencm
Copy link
Copy Markdown
Member

@rubencm rubencm commented Dec 23, 2024

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17447

Depends on #6753

@rubencm rubencm marked this pull request as draft January 18, 2025 13:49
@rubencm rubencm marked this pull request as ready for review October 25, 2025 23:47
@rubencm rubencm requested review from Copilot and marc1706 October 26, 2025 20:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds HTTP range request support for attachment downloads in phpBB. The implementation enables partial content delivery (e.g., for video streaming and resumable downloads) by leveraging Symfony's BinaryFileResponse for local storage while maintaining backward compatibility with other storage providers through StreamedResponse.

Key Changes:

  • Refactored the attachment controller to use BinaryFileResponse for local storage (which natively supports range requests) and StreamedResponse for other storage providers
  • Consolidated database connection cleanup and cache unloading logic across storage controllers
  • Replaced deprecated makeDisposition calls with HeaderUtils::makeDisposition

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
phpBB/phpbb/storage/controller/controller.php Moved response preparation logic from prepare() to handle() method; removed file_gc() method
phpBB/phpbb/storage/controller/avatar.php Updated to use HeaderUtils::makeDisposition and changed type hint from StreamedResponse to Response
phpBB/phpbb/storage/controller/attachment.php Refactored to no longer extend controller class; added conditional logic for BinaryFileResponse vs StreamedResponse; extracted database queries into helper methods
phpBB/develop/adjust_avatars.php Fixed incorrect config key check from avatar to attachment provider

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marc1706 marc1706 merged commit 9cb3d4d into phpbb:master Mar 28, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants