{"action":"created","issue":{"url":"https://api.github.com/repos/EthanKennedy/wpe-advanced-cache/issues/14","repository_url":"https://api.github.com/repos/EthanKennedy/wpe-advanced-cache","labels_url":"https://api.github.com/repos/EthanKennedy/wpe-advanced-cache/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/EthanKennedy/wpe-advanced-cache/issues/14/comments","events_url":"https://api.github.com/repos/EthanKennedy/wpe-advanced-cache/issues/14/events","html_url":"https://github.com/EthanKennedy/wpe-advanced-cache/issues/14","id":367872011,"node_id":"MDU6SXNzdWUzNjc4NzIwMTE=","number":14,"title":"Checking for headers_sent","user":{"login":"thefrosty","id":367897,"node_id":"MDQ6VXNlcjM2Nzg5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/367897?v=4","gravatar_id":"","url":"https://api.github.com/users/thefrosty","html_url":"https://github.com/thefrosty","followers_url":"https://api.github.com/users/thefrosty/followers","following_url":"https://api.github.com/users/thefrosty/following{/other_user}","gists_url":"https://api.github.com/users/thefrosty/gists{/gist_id}","starred_url":"https://api.github.com/users/thefrosty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefrosty/subscriptions","organizations_url":"https://api.github.com/users/thefrosty/orgs","repos_url":"https://api.github.com/users/thefrosty/repos","events_url":"https://api.github.com/users/thefrosty/events{/privacy}","received_events_url":"https://api.github.com/users/thefrosty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-08T16:47:08Z","updated_at":"2018-10-08T17:00:58Z","closed_at":null,"author_association":"NONE","body":"We're got a REST Api theme that shows an posts REST data. And since it's building a request during the theme build it's after headers have already been sent. The `WPEAC_CORE::send_header_cache_control_api` method should wrapper the header function in a condition to check if the headers have been sent yet to avoid errors.\r\n\r\n```\r\nif (!headers_sent()) {\r\n    header(\"Cache-Control: max-age=$namespace_cache_length, must-revalidate\");\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/EthanKennedy/wpe-advanced-cache/issues/comments/427908187","html_url":"https://github.com/EthanKennedy/wpe-advanced-cache/issues/14#issuecomment-427908187","issue_url":"https://api.github.com/repos/EthanKennedy/wpe-advanced-cache/issues/14","id":427908187,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzkwODE4Nw==","user":{"login":"EthanKennedy","id":12632467,"node_id":"MDQ6VXNlcjEyNjMyNDY3","avatar_url":"https://avatars3.githubusercontent.com/u/12632467?v=4","gravatar_id":"","url":"https://api.github.com/users/EthanKennedy","html_url":"https://github.com/EthanKennedy","followers_url":"https://api.github.com/users/EthanKennedy/followers","following_url":"https://api.github.com/users/EthanKennedy/following{/other_user}","gists_url":"https://api.github.com/users/EthanKennedy/gists{/gist_id}","starred_url":"https://api.github.com/users/EthanKennedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EthanKennedy/subscriptions","organizations_url":"https://api.github.com/users/EthanKennedy/orgs","repos_url":"https://api.github.com/users/EthanKennedy/repos","events_url":"https://api.github.com/users/EthanKennedy/events{/privacy}","received_events_url":"https://api.github.com/users/EthanKennedy/received_events","type":"User","site_admin":false},"created_at":"2018-10-08T17:00:58Z","updated_at":"2018-10-08T17:00:58Z","author_association":"OWNER","body":"Yeah that makes a lot of sense, the check should exist in `WPEAC_CORE::send_header_cache_control_api` as well. I'll add it and test to see if anything behaves oddly, if not I'll push an update. "}}
{"actor":{"display_login":"EthanKennedy"}}