payload: {"action":"created","issue":{"url":"https://api.github.com/repos/wp-erp/wp-erp/issues/752","repository_url":"https://api.github.com/repos/wp-erp/wp-erp","labels_url":"https://api.github.com/repos/wp-erp/wp-erp/issues/752/labels{/name}","comments_url":"https://api.github.com/repos/wp-erp/wp-erp/issues/752/comments","events_url":"https://api.github.com/repos/wp-erp/wp-erp/issues/752/events","html_url":"https://github.com/wp-erp/wp-erp/pull/752","id":394943466,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNTM2NDU0","number":752,"title":"the safiest way to find out when https is used","user":{"login":"pexlechris","id":46229233,"node_id":"MDQ6VXNlcjQ2MjI5MjMz","avatar_url":"https://avatars3.githubusercontent.com/u/46229233?v=4","gravatar_id":"","url":"https://api.github.com/users/pexlechris","html_url":"https://github.com/pexlechris","followers_url":"https://api.github.com/users/pexlechris/followers","following_url":"https://api.github.com/users/pexlechris/following{/other_user}","gists_url":"https://api.github.com/users/pexlechris/gists{/gist_id}","starred_url":"https://api.github.com/users/pexlechris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pexlechris/subscriptions","organizations_url":"https://api.github.com/users/pexlechris/orgs","repos_url":"https://api.github.com/users/pexlechris/repos","events_url":"https://api.github.com/users/pexlechris/events{/privacy}","received_events_url":"https://api.github.com/users/pexlechris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-31T07:58:46Z","updated_at":"2019-02-18T12:10:53Z","closed_at":"2019-02-18T12:10:53Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/wp-erp/wp-erp/pulls/752","html_url":"https://github.com/wp-erp/wp-erp/pull/752","diff_url":"https://github.com/wp-erp/wp-erp/pull/752.diff","patch_url":"https://github.com/wp-erp/wp-erp/pull/752.patch"},"body":"<!-- Thanks for contributing to WP ERP! Please provide as much information as possible with your Pull Request by filling out the following - this helps make reviewing much quicker! -->\r\n\r\n#### Changes proposed in this Pull Request:\r\nI change the way the php identifying WHEN https is used by EACH server!\r\n\r\nIn the php manual (http://php.net/reserved.variables.server )we see that it says that $_SERVER['HTTPS'] set to a non-empty value if the script was queried through the HTTPS protocol, but when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol.\r\n\r\nIn addiction, with more research (https://stackoverflow.com/questions/1175096/how-to-find-out-if-youre-using-https-without-serverhttps/2886224), I found out that a reverse proxy (load balancer) not understand all the time the variable $_SERVER['HTTPS'], so in this case we must use $_SERVER['HTTP_X_FORWARDED_PROTO'] variable. This operates good in load balancers,  in AWS Elastic\r\nand in CloudFlare. More you can see in the link  above!\r\n\r\n#### Related issue(s):\r\nhttps, ssl, servers"},"comment":{"url":"https://api.github.com/repos/wp-erp/wp-erp/issues/comments/464709503","html_url":"https://github.com/wp-erp/wp-erp/pull/752#issuecomment-464709503","issue_url":"https://api.github.com/repos/wp-erp/wp-erp/issues/752","id":464709503,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2NDcwOTUwMw==","user":{"login":"tareq1988","id":153669,"node_id":"MDQ6VXNlcjE1MzY2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/153669?v=4","gravatar_id":"","url":"https://api.github.com/users/tareq1988","html_url":"https://github.com/tareq1988","followers_url":"https://api.github.com/users/tareq1988/followers","following_url":"https://api.github.com/users/tareq1988/following{/other_user}","gists_url":"https://api.github.com/users/tareq1988/gists{/gist_id}","starred_url":"https://api.github.com/users/tareq1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tareq1988/subscriptions","organizations_url":"https://api.github.com/users/tareq1988/orgs","repos_url":"https://api.github.com/users/tareq1988/repos","events_url":"https://api.github.com/users/tareq1988/events{/privacy}","received_events_url":"https://api.github.com/users/tareq1988/received_events","type":"User","site_admin":false},"created_at":"2019-02-18T12:10:53Z","updated_at":"2019-02-18T12:10:53Z","author_association":"CONTRIBUTOR","body":"Though the mentioned problem is valid, it's a known issue. The [is_ssl()](https://developer.wordpress.org/reference/functions/is_ssl/) implementation is buggy for the same problem and hasn't been fixed. It should be fixed in WordPress core, not in a plugin.\r\n\r\nThe temporary fix is to add this code in your `wp-config.php` file.\r\n\r\n```if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\r\n    $_SERVER['HTTPS'] = 'on';\r\n}```"}}
other: {"actor":{"display_login":"tareq1988"}}