{"action":"created","issue":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1546","repository_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1546/labels{/name}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1546/comments","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1546/events","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1546","id":122742659,"number":1546,"title":"Fix EZP-25204: FosHttpCache sets 'Vary:Cookie' for forward requests.","user":{"login":"joaoinacio","id":1168342,"avatar_url":"https://avatars.githubusercontent.com/u/1168342?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoinacio","html_url":"https://github.com/joaoinacio","followers_url":"https://api.github.com/users/joaoinacio/followers","following_url":"https://api.github.com/users/joaoinacio/following{/other_user}","gists_url":"https://api.github.com/users/joaoinacio/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoinacio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoinacio/subscriptions","organizations_url":"https://api.github.com/users/joaoinacio/orgs","repos_url":"https://api.github.com/users/joaoinacio/repos","events_url":"https://api.github.com/users/joaoinacio/events{/privacy}","received_events_url":"https://api.github.com/users/joaoinacio/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-17T14:17:02Z","updated_at":"2016-02-18T23:56:10Z","closed_at":"2016-01-06T16:32:47Z","pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1546","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1546","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1546.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1546.patch"},"body":"…ward requests.\r\n\r\nJIRA: https://jira.ez.no/browse/EZP-25204\r\n\r\n### Problem:\r\nWhen performing internal request forwards (such as using a non-default `index_page` as described in the JIRA issue), FOSHttpCache will add headers to the `Vary:` response header.\r\n\r\nThis happens because it will not find the `user_hash_header` , so will add what is defined in `user_identifier_headers` : `Cookie` and `Authentication` by default.\r\nRef: https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/blob/master/EventListener/UserContextSubscriber.php#L134\r\n\r\n#### Solution:\r\nThe suggested approach is to: \r\n1. add the user-hash header to the forwarded request if it is already set, and\r\n2. (optional) remove 'Cookie' from the `user_identifier_headers` config, as ezp kernel implements and uses its own user-hash generator, and the cookie vary should be added when necessary.\r\n\r\nping @lolautruche ?\r\n"},"comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments/185984870","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1546#issuecomment-185984870","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1546","id":185984870,"user":{"login":"andrerom","id":289757,"avatar_url":"https://avatars.githubusercontent.com/u/289757?v=3","gravatar_id":"","url":"https://api.github.com/users/andrerom","html_url":"https://github.com/andrerom","followers_url":"https://api.github.com/users/andrerom/followers","following_url":"https://api.github.com/users/andrerom/following{/other_user}","gists_url":"https://api.github.com/users/andrerom/gists{/gist_id}","starred_url":"https://api.github.com/users/andrerom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrerom/subscriptions","organizations_url":"https://api.github.com/users/andrerom/orgs","repos_url":"https://api.github.com/users/andrerom/repos","events_url":"https://api.github.com/users/andrerom/events{/privacy}","received_events_url":"https://api.github.com/users/andrerom/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T23:56:10Z","updated_at":"2016-02-18T23:56:10Z","body":"> @dbu:  this would need an answer from the eZ people. i am surprised by this\r\ncode, but i don't know the eZ code. i just feel either it would be\r\n\r\nNo input to give whiteout digging into it, @lolautruche could perhaps if he sees this."}}