Fix/Ajax download#83
Open
TDannhauer wants to merge 3 commits intoFRAMEWORK_6_0from
Open
Conversation
This class handles download service requests in a PSR-15 compliant manner, processing parameters and returning appropriate responses based on the request.
Added detailed PHPDoc comments to DownloadController class, explaining its purpose and usage as a PSR-15 controller for download service dispatch.
Added a new download service route with specified methods and defaults.
Contributor
Author
|
fixes together with PR horde/imp#38 issue horde/imp#37 |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds PSR-15-compatible download handling for routed requests by introducing a dedicated download controller and wiring explicit download routes in Horde routing config.
Context / Problem
Attachment downloads in routed/mobile flows could fall through the middleware stack and end in a generic fallback response (
No Response by middleware or payload Handler) when no matching download endpoint was resolved in the PSR-15 path.Historically, downloads were handled by the legacy script endpoint (
services/download/index.php). As traffic increasingly goes through the router/middleware pipeline, that behavior needed an equivalent PSR-15 entry point.Changes
vendor/horde/horde/config/routes.phpAdded an explicit download service route in Horde routes:
/services/download//services/download(no trailing slash variant)DownloadController::classHordeAuthType => 'NONE'GET,POSTWhy this matters
vendor/horde/horde/src/DownloadController.php(new file)Introduced a dedicated PSR-15 request handler for download service dispatch.
What it does
Psr\Http\Server\RequestHandlerInterface.Variables(legacy-compatible input shape).fnintofilename.$registry->callAppMethod($vars->app, 'download', ['args' => [$vars]])Content-TypeContent-DispositionContent-LengthCache-ControlWhy a separate controller
AjaxDispatchController= AJAX dispatch/envelope flowDownloadController= binary/file response flowBehavioral Impact
/services/download+/services/download/support.downloadAPI methods.Backward Compatibility / Risk
Validation Performed
vendor/horde/horde/config/routes.phpvendor/horde/horde/src/DownloadController.phpTest Plan
application/pdf, images, generic binary)./services/ajax.php/...).