{"action":"created","issue":{"url":"https://api.github.com/repos/slimphp/Slim/issues/1339","labels_url":"https://api.github.com/repos/slimphp/Slim/issues/1339/labels{/name}","comments_url":"https://api.github.com/repos/slimphp/Slim/issues/1339/comments","events_url":"https://api.github.com/repos/slimphp/Slim/issues/1339/events","html_url":"https://github.com/slimphp/Slim/issues/1339","id":92943505,"number":1339,"title":"app middleware is not invoked when doing subRequest","user":{"login":"kminek","id":373962,"avatar_url":"https://avatars.githubusercontent.com/u/373962?v=3","gravatar_id":"","url":"https://api.github.com/users/kminek","html_url":"https://github.com/kminek","followers_url":"https://api.github.com/users/kminek/followers","following_url":"https://api.github.com/users/kminek/following{/other_user}","gists_url":"https://api.github.com/users/kminek/gists{/gist_id}","starred_url":"https://api.github.com/users/kminek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kminek/subscriptions","organizations_url":"https://api.github.com/users/kminek/orgs","repos_url":"https://api.github.com/users/kminek/repos","events_url":"https://api.github.com/users/kminek/events{/privacy}","received_events_url":"https://api.github.com/users/kminek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-03T22:23:27Z","updated_at":"2015-07-03T22:59:22Z","closed_at":null,"body":"sample code:\r\n\r\n```php\r\n$app = new Slim\\App();\r\n\r\n$app->add(function ($req, $res, $next) {\r\n    $res->write('BEFORE');\r\n    return $next($req, $res);\r\n});\r\n\r\n$app->get('/', function ($request, $response, $args) {\r\n    return $this->subRequest('GET', '/hello/grzes');\r\n});\r\n\r\n$app->get('/hello/{name}', function ($request, $response, $args) {\r\n    $response->write(\"Hello, \" . $args['name']);\r\n    return $response;\r\n});\r\n\r\n$app->run();\r\n```"},"comment":{"url":"https://api.github.com/repos/slimphp/Slim/issues/comments/118436313","html_url":"https://github.com/slimphp/Slim/issues/1339#issuecomment-118436313","issue_url":"https://api.github.com/repos/slimphp/Slim/issues/1339","id":118436313,"user":{"login":"Lewiscowles1986","id":2605791,"avatar_url":"https://avatars.githubusercontent.com/u/2605791?v=3","gravatar_id":"","url":"https://api.github.com/users/Lewiscowles1986","html_url":"https://github.com/Lewiscowles1986","followers_url":"https://api.github.com/users/Lewiscowles1986/followers","following_url":"https://api.github.com/users/Lewiscowles1986/following{/other_user}","gists_url":"https://api.github.com/users/Lewiscowles1986/gists{/gist_id}","starred_url":"https://api.github.com/users/Lewiscowles1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lewiscowles1986/subscriptions","organizations_url":"https://api.github.com/users/Lewiscowles1986/orgs","repos_url":"https://api.github.com/users/Lewiscowles1986/repos","events_url":"https://api.github.com/users/Lewiscowles1986/events{/privacy}","received_events_url":"https://api.github.com/users/Lewiscowles1986/received_events","type":"User","site_admin":false},"created_at":"2015-07-03T22:59:22Z","updated_at":"2015-07-03T22:59:22Z","body":"surely the subRequest could be replaced with an API call or command pattern, if for example Auth and ACL, session data was needed. Is this the desired reason for using middleware on subRequest?"}}