-
Notifications
You must be signed in to change notification settings - Fork 1
Description
The API_Framework controller event short circuits page rendering with the following code in it's load() method:
api_framework/events/event.controller.php
Lines 137 to 138 in 46b86ef
| $response->send(); | |
| exit; |
This means that the custom headers like X-API-Framework-Render-Time aren't added like they are with a GET request. Also, the delegate(s) APIFrameworkJSONRendererAppendTransformations and JsonFrontendPreRenderHeaders are never triggered.
It would be nice if the render pipeline for both controller driven and non-controller driven requests (i.e. GET vs POST/PUT/PATCH/DELETE) ends in the same place to allow the same headers to be added and delegates to be triggered. If this isn't possible, at the very least, a new delegate should be added before the controller events send the response. E.g.
/* * This is just prior to the page headers being re-rendered * @delegate JsonFrontendPreRenderHeaders_ControllerEvent * @param string $context * '/json_frontend/' */ \Symphony::ExtensionManager()->notifyMembers( 'JsonFrontendPreRenderHeaders_ControllerEvent', '/json_frontend/', ["response" => &$response] );