{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/comments/34377909","id":34377909,"diff_hunk":"@@ -779,11 +779,17 @@ def render_template(name)\n       error 400,\n         :error => _(\"The nic_max parameter must be an integer not starting with 0\")\n \n-    params['http_port'].nil? and request.secure? and\n-      error 400,\n-        :error => _(\"The `http_port` argument must be supplied for bootstrap generation on a secure port\")\n-\n-    @bootstrap_port = params['http_port'].nil? ? request.port.to_s : params['http_port']\n+    is_nil = params[\"http_port\"].nil?\n+    is_in_range = (params[\"http_port\"] =~ /\\A[1-9][0-9]?[0-9]?[0-9]?[0-9]?\\Z/ and","path":"app.rb","position":10,"original_position":10,"commit_id":"a084230480c1940c4e2fe56c139c06f4f16e497c","original_commit_id":"a084230480c1940c4e2fe56c139c06f4f16e497c","user":{"login":"pcarlisle","id":1234752,"avatar_url":"https://avatars.githubusercontent.com/u/1234752?v=3","gravatar_id":"","url":"https://api.github.com/users/pcarlisle","html_url":"https://github.com/pcarlisle","followers_url":"https://api.github.com/users/pcarlisle/followers","following_url":"https://api.github.com/users/pcarlisle/following{/other_user}","gists_url":"https://api.github.com/users/pcarlisle/gists{/gist_id}","starred_url":"https://api.github.com/users/pcarlisle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcarlisle/subscriptions","organizations_url":"https://api.github.com/users/pcarlisle/orgs","repos_url":"https://api.github.com/users/pcarlisle/repos","events_url":"https://api.github.com/users/pcarlisle/events{/privacy}","received_events_url":"https://api.github.com/users/pcarlisle/received_events","type":"User","site_admin":false},"body":"Seems a little more readable as\r\n`/\\A[1-9][0-9]{4}\\Z/`","created_at":"2015-07-10T17:45:59Z","updated_at":"2015-07-10T17:45:59Z","html_url":"https://github.com/puppetlabs/razor-server/pull/299#discussion_r34377909","pull_request_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/comments/34377909"},"html":{"href":"https://github.com/puppetlabs/razor-server/pull/299#discussion_r34377909"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299","id":33080036,"html_url":"https://github.com/puppetlabs/razor-server/pull/299","diff_url":"https://github.com/puppetlabs/razor-server/pull/299.diff","patch_url":"https://github.com/puppetlabs/razor-server/pull/299.patch","issue_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/299","number":299,"state":"open","locked":false,"title":"Guess HTTP port when generating bootstrap file","user":{"login":"smcclellan","id":6577757,"avatar_url":"https://avatars.githubusercontent.com/u/6577757?v=3","gravatar_id":"","url":"https://api.github.com/users/smcclellan","html_url":"https://github.com/smcclellan","followers_url":"https://api.github.com/users/smcclellan/followers","following_url":"https://api.github.com/users/smcclellan/following{/other_user}","gists_url":"https://api.github.com/users/smcclellan/gists{/gist_id}","starred_url":"https://api.github.com/users/smcclellan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcclellan/subscriptions","organizations_url":"https://api.github.com/users/smcclellan/orgs","repos_url":"https://api.github.com/users/smcclellan/repos","events_url":"https://api.github.com/users/smcclellan/events{/privacy}","received_events_url":"https://api.github.com/users/smcclellan/received_events","type":"User","site_admin":false},"body":"The decision tree for what port to use for the bootstrap URL is now as follows:\r\n- Is a valid `http_port` argument supplied? Use that. (Throw error on invalid.)\r\n- Is the HTTP_PORT environment variable defined? Use that.\r\n- Is the request secure? Use 8150 as a constant default.\r\n- Otherwise, use the port where the request was received.\r\n\r\nFixes https://tickets.puppetlabs.com/browse/RAZOR-549","created_at":"2015-04-10T20:20:45Z","updated_at":"2015-07-10T17:45:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d21d544fc4677c37e96c3e1bfd7bfc5b3a5bd4ec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/299/comments","statuses_url":"https://api.github.com/repos/puppetlabs/razor-server/statuses/a084230480c1940c4e2fe56c139c06f4f16e497c","head":{"label":"smcclellan:guess-http-port-bootstrapping","ref":"guess-http-port-bootstrapping","sha":"a084230480c1940c4e2fe56c139c06f4f16e497c","user":{"login":"smcclellan","id":6577757,"avatar_url":"https://avatars.githubusercontent.com/u/6577757?v=3","gravatar_id":"","url":"https://api.github.com/users/smcclellan","html_url":"https://github.com/smcclellan","followers_url":"https://api.github.com/users/smcclellan/followers","following_url":"https://api.github.com/users/smcclellan/following{/other_user}","gists_url":"https://api.github.com/users/smcclellan/gists{/gist_id}","starred_url":"https://api.github.com/users/smcclellan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcclellan/subscriptions","organizations_url":"https://api.github.com/users/smcclellan/orgs","repos_url":"https://api.github.com/users/smcclellan/repos","events_url":"https://api.github.com/users/smcclellan/events{/privacy}","received_events_url":"https://api.github.com/users/smcclellan/received_events","type":"User","site_admin":false},"repo":{"id":17226113,"name":"razor-server","full_name":"smcclellan/razor-server","owner":{"login":"smcclellan","id":6577757,"avatar_url":"https://avatars.githubusercontent.com/u/6577757?v=3","gravatar_id":"","url":"https://api.github.com/users/smcclellan","html_url":"https://github.com/smcclellan","followers_url":"https://api.github.com/users/smcclellan/followers","following_url":"https://api.github.com/users/smcclellan/following{/other_user}","gists_url":"https://api.github.com/users/smcclellan/gists{/gist_id}","starred_url":"https://api.github.com/users/smcclellan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcclellan/subscriptions","organizations_url":"https://api.github.com/users/smcclellan/orgs","repos_url":"https://api.github.com/users/smcclellan/repos","events_url":"https://api.github.com/users/smcclellan/events{/privacy}","received_events_url":"https://api.github.com/users/smcclellan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smcclellan/razor-server","description":"Razor is next generation provisioning software that handles bare metal hardware and virtual server provisioning","fork":true,"url":"https://api.github.com/repos/smcclellan/razor-server","forks_url":"https://api.github.com/repos/smcclellan/razor-server/forks","keys_url":"https://api.github.com/repos/smcclellan/razor-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smcclellan/razor-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smcclellan/razor-server/teams","hooks_url":"https://api.github.com/repos/smcclellan/razor-server/hooks","issue_events_url":"https://api.github.com/repos/smcclellan/razor-server/issues/events{/number}","events_url":"https://api.github.com/repos/smcclellan/razor-server/events","assignees_url":"https://api.github.com/repos/smcclellan/razor-server/assignees{/user}","branches_url":"https://api.github.com/repos/smcclellan/razor-server/branches{/branch}","tags_url":"https://api.github.com/repos/smcclellan/razor-server/tags","blobs_url":"https://api.github.com/repos/smcclellan/razor-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smcclellan/razor-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smcclellan/razor-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/smcclellan/razor-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smcclellan/razor-server/statuses/{sha}","languages_url":"https://api.github.com/repos/smcclellan/razor-server/languages","stargazers_url":"https://api.github.com/repos/smcclellan/razor-server/stargazers","contributors_url":"https://api.github.com/repos/smcclellan/razor-server/contributors","subscribers_url":"https://api.github.com/repos/smcclellan/razor-server/subscribers","subscription_url":"https://api.github.com/repos/smcclellan/razor-server/subscription","commits_url":"https://api.github.com/repos/smcclellan/razor-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/smcclellan/razor-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/smcclellan/razor-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/smcclellan/razor-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/smcclellan/razor-server/contents/{+path}","compare_url":"https://api.github.com/repos/smcclellan/razor-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smcclellan/razor-server/merges","archive_url":"https://api.github.com/repos/smcclellan/razor-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smcclellan/razor-server/downloads","issues_url":"https://api.github.com/repos/smcclellan/razor-server/issues{/number}","pulls_url":"https://api.github.com/repos/smcclellan/razor-server/pulls{/number}","milestones_url":"https://api.github.com/repos/smcclellan/razor-server/milestones{/number}","notifications_url":"https://api.github.com/repos/smcclellan/razor-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smcclellan/razor-server/labels{/name}","releases_url":"https://api.github.com/repos/smcclellan/razor-server/releases{/id}","created_at":"2014-02-26T21:32:27Z","updated_at":"2015-03-13T23:07:19Z","pushed_at":"2015-07-10T17:35:01Z","git_url":"git://github.com/smcclellan/razor-server.git","ssh_url":"git@github.com:smcclellan/razor-server.git","clone_url":"https://github.com/smcclellan/razor-server.git","svn_url":"https://github.com/smcclellan/razor-server","homepage":"","size":3671,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"puppetlabs:master","ref":"master","sha":"d745d3093291ae908dfcbdfc1660d67f968ce242","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":10631737,"name":"razor-server","full_name":"puppetlabs/razor-server","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/razor-server","description":"Razor is next generation provisioning software that handles bare metal hardware and virtual server provisioning","fork":false,"url":"https://api.github.com/repos/puppetlabs/razor-server","forks_url":"https://api.github.com/repos/puppetlabs/razor-server/forks","keys_url":"https://api.github.com/repos/puppetlabs/razor-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/razor-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/razor-server/teams","hooks_url":"https://api.github.com/repos/puppetlabs/razor-server/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/razor-server/events","assignees_url":"https://api.github.com/repos/puppetlabs/razor-server/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/razor-server/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/razor-server/tags","blobs_url":"https://api.github.com/repos/puppetlabs/razor-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/razor-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/razor-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/razor-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/razor-server/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/razor-server/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/razor-server/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/razor-server/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/razor-server/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/razor-server/subscription","commits_url":"https://api.github.com/repos/puppetlabs/razor-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/razor-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/razor-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/razor-server/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/razor-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/razor-server/merges","archive_url":"https://api.github.com/repos/puppetlabs/razor-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/razor-server/downloads","issues_url":"https://api.github.com/repos/puppetlabs/razor-server/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/razor-server/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/razor-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/razor-server/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/razor-server/releases{/id}","created_at":"2013-06-11T21:55:35Z","updated_at":"2015-07-01T13:12:43Z","pushed_at":"2015-07-10T17:35:02Z","git_url":"git://github.com/puppetlabs/razor-server.git","ssh_url":"git@github.com:puppetlabs/razor-server.git","clone_url":"https://github.com/puppetlabs/razor-server.git","svn_url":"https://github.com/puppetlabs/razor-server","homepage":"","size":5950,"stargazers_count":271,"watchers_count":271,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":96,"mirror_url":null,"open_issues_count":18,"forks":96,"open_issues":18,"watchers":271,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299"},"html":{"href":"https://github.com/puppetlabs/razor-server/pull/299"},"issue":{"href":"https://api.github.com/repos/puppetlabs/razor-server/issues/299"},"comments":{"href":"https://api.github.com/repos/puppetlabs/razor-server/issues/299/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/299/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/razor-server/statuses/a084230480c1940c4e2fe56c139c06f4f16e497c"}}}}