{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-view/pulls/comments/32430009","id":32430009,"diff_hunk":"@@ -85,6 +85,16 @@ protected function detectHost()\n                     $this->setHost(substr($_SERVER['HTTP_HOST'], 0, 0-strlen($portStr)));\n                     return;\n                 }\n+\n+                // If the Host header contains a port, and it differs from the\n+                // SERVER_PORT, use the port from the Host header. Typically\n+                // this is a situation where port-forwarding is in use, and you\n+                // want to present a URI using the public port.","path":"src/Helper/ServerUrl.php","position":8,"original_position":8,"commit_id":"43f4bce94293eeac64c995ec6339b4b3f801fee1","original_commit_id":"43f4bce94293eeac64c995ec6339b4b3f801fee1","user":{"login":"akrabat","id":33135,"avatar_url":"https://avatars.githubusercontent.com/u/33135?v=3","gravatar_id":"","url":"https://api.github.com/users/akrabat","html_url":"https://github.com/akrabat","followers_url":"https://api.github.com/users/akrabat/followers","following_url":"https://api.github.com/users/akrabat/following{/other_user}","gists_url":"https://api.github.com/users/akrabat/gists{/gist_id}","starred_url":"https://api.github.com/users/akrabat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrabat/subscriptions","organizations_url":"https://api.github.com/users/akrabat/orgs","repos_url":"https://api.github.com/users/akrabat/repos","events_url":"https://api.github.com/users/akrabat/events{/privacy}","received_events_url":"https://api.github.com/users/akrabat/received_events","type":"User","site_admin":false},"body":"Hmm... we should probably extract the port from HTTP_PORT once then :)","created_at":"2015-06-15T15:09:11Z","updated_at":"2015-06-15T15:09:11Z","html_url":"https://github.com/zendframework/zend-view/pull/4#discussion_r32430009","pull_request_url":"https://api.github.com/repos/zendframework/zend-view/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-view/pulls/comments/32430009"},"html":{"href":"https://github.com/zendframework/zend-view/pull/4#discussion_r32430009"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-view/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-view/pulls/4","id":37692356,"html_url":"https://github.com/zendframework/zend-view/pull/4","diff_url":"https://github.com/zendframework/zend-view/pull/4.diff","patch_url":"https://github.com/zendframework/zend-view/pull/4.patch","issue_url":"https://api.github.com/repos/zendframework/zend-view/issues/4","number":4,"state":"open","locked":false,"title":"Use the Host port when port forwarding is detected","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"body":"In vagrant and other systems, you often have a port on the host forwarding to a port on the client box. In terms of ServerUrl, the port on the host server is the public one that should be used.\n\nPrior to this patch ServerUrl was detecting both the port from the Host header, as well as SERVER_PORT, and using *both* in generated URLs.\n\nAs an example, given:\n\n- HTTP_HOST: localhost:10088\n- SERVER_PORT: 10081\n\nServerUrl would generate the host \"localhost:10088:10081\", when it should be generating \"localhost:10088\". This patch corrects the situation.","created_at":"2015-06-15T13:43:00Z","updated_at":"2015-06-15T15:09:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4be86b7ccfeed36f3cc1a62ddf3a8085bdcb5409","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zendframework/zend-view/pulls/4/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-view/pulls/4/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-view/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-view/issues/4/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-view/statuses/43f4bce94293eeac64c995ec6339b4b3f801fee1","head":{"label":"weierophinney:hotfix/server-url-port-forward","ref":"hotfix/server-url-port-forward","sha":"43f4bce94293eeac64c995ec6339b4b3f801fee1","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"repo":{"id":37467484,"name":"zend-view","full_name":"weierophinney/zend-view","owner":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weierophinney/zend-view","description":"View component from Zend Framework","fork":true,"url":"https://api.github.com/repos/weierophinney/zend-view","forks_url":"https://api.github.com/repos/weierophinney/zend-view/forks","keys_url":"https://api.github.com/repos/weierophinney/zend-view/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weierophinney/zend-view/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weierophinney/zend-view/teams","hooks_url":"https://api.github.com/repos/weierophinney/zend-view/hooks","issue_events_url":"https://api.github.com/repos/weierophinney/zend-view/issues/events{/number}","events_url":"https://api.github.com/repos/weierophinney/zend-view/events","assignees_url":"https://api.github.com/repos/weierophinney/zend-view/assignees{/user}","branches_url":"https://api.github.com/repos/weierophinney/zend-view/branches{/branch}","tags_url":"https://api.github.com/repos/weierophinney/zend-view/tags","blobs_url":"https://api.github.com/repos/weierophinney/zend-view/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weierophinney/zend-view/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weierophinney/zend-view/git/refs{/sha}","trees_url":"https://api.github.com/repos/weierophinney/zend-view/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weierophinney/zend-view/statuses/{sha}","languages_url":"https://api.github.com/repos/weierophinney/zend-view/languages","stargazers_url":"https://api.github.com/repos/weierophinney/zend-view/stargazers","contributors_url":"https://api.github.com/repos/weierophinney/zend-view/contributors","subscribers_url":"https://api.github.com/repos/weierophinney/zend-view/subscribers","subscription_url":"https://api.github.com/repos/weierophinney/zend-view/subscription","commits_url":"https://api.github.com/repos/weierophinney/zend-view/commits{/sha}","git_commits_url":"https://api.github.com/repos/weierophinney/zend-view/git/commits{/sha}","comments_url":"https://api.github.com/repos/weierophinney/zend-view/comments{/number}","issue_comment_url":"https://api.github.com/repos/weierophinney/zend-view/issues/comments{/number}","contents_url":"https://api.github.com/repos/weierophinney/zend-view/contents/{+path}","compare_url":"https://api.github.com/repos/weierophinney/zend-view/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weierophinney/zend-view/merges","archive_url":"https://api.github.com/repos/weierophinney/zend-view/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weierophinney/zend-view/downloads","issues_url":"https://api.github.com/repos/weierophinney/zend-view/issues{/number}","pulls_url":"https://api.github.com/repos/weierophinney/zend-view/pulls{/number}","milestones_url":"https://api.github.com/repos/weierophinney/zend-view/milestones{/number}","notifications_url":"https://api.github.com/repos/weierophinney/zend-view/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weierophinney/zend-view/labels{/name}","releases_url":"https://api.github.com/repos/weierophinney/zend-view/releases{/id}","created_at":"2015-06-15T13:41:46Z","updated_at":"2015-06-15T13:41:47Z","pushed_at":"2015-06-15T13:42:43Z","git_url":"git://github.com/weierophinney/zend-view.git","ssh_url":"git@github.com:weierophinney/zend-view.git","clone_url":"https://github.com/weierophinney/zend-view.git","svn_url":"https://github.com/weierophinney/zend-view","homepage":"https://github.com/zendframework/zf2","size":4075,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zendframework:master","ref":"master","sha":"7a0dd8febfee75f0808e06bcff4ecaa2bc6b703c","user":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"repo":{"id":35280838,"name":"zend-view","full_name":"zendframework/zend-view","owner":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendframework/zend-view","description":"View component from Zend Framework","fork":false,"url":"https://api.github.com/repos/zendframework/zend-view","forks_url":"https://api.github.com/repos/zendframework/zend-view/forks","keys_url":"https://api.github.com/repos/zendframework/zend-view/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-view/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-view/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-view/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-view/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-view/events","assignees_url":"https://api.github.com/repos/zendframework/zend-view/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-view/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-view/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-view/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-view/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-view/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-view/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-view/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-view/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-view/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-view/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-view/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-view/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-view/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-view/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-view/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-view/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-view/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-view/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-view/merges","archive_url":"https://api.github.com/repos/zendframework/zend-view/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-view/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-view/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-view/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-view/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-view/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-view/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-view/releases{/id}","created_at":"2015-05-08T13:28:16Z","updated_at":"2015-06-15T14:02:54Z","pushed_at":"2015-06-15T13:43:00Z","git_url":"git://github.com/zendframework/zend-view.git","ssh_url":"git@github.com:zendframework/zend-view.git","clone_url":"https://github.com/zendframework/zend-view.git","svn_url":"https://github.com/zendframework/zend-view","homepage":"https://github.com/zendframework/zf2","size":4367,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-view/pulls/4"},"html":{"href":"https://github.com/zendframework/zend-view/pull/4"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-view/issues/4"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-view/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-view/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-view/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-view/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-view/statuses/43f4bce94293eeac64c995ec6339b4b3f801fee1"}}}}