{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/37121748","id":37121748,"diff_hunk":"@@ -388,6 +388,25 @@ def _fetch\n   end\n end\n \n+class CurlSourceForgeSecureMirrorDownloadStrategy < CurlDownloadStrategy\n+  def fetch\n+    if !ENV[\"HOMEBREW_NO_INSECURE_REDIRECT\"].nil?\n+      oldurl = @url\n+      @url = https_mirror\n+      ohai \"Sourceforge HTTPS: #{oldurl}\"\n+      ohai \"=> converted to #{@url}\"\n+    end\n+    super\n+  end\n+\n+  def https_mirror\n+     re = /(^https?:\\/\\/)(.+\\.net\\/project\\/)(.+)/\n+     @url.gsub(re) do\n+       $1 + \"www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/\" + $3[0] + \"/\" + $3[0,2] + \"/\" + $3","path":"Library/Homebrew/download_strategy.rb","position":19,"original_position":18,"commit_id":"84f86a095bfe91425bbdc5a6fa67b7cdc565f71b","original_commit_id":"4f99dea4f873becba7948c5395859ff8ab31a653","user":{"login":"bfontaine","id":1334295,"avatar_url":"https://avatars.githubusercontent.com/u/1334295?v=3","gravatar_id":"","url":"https://api.github.com/users/bfontaine","html_url":"https://github.com/bfontaine","followers_url":"https://api.github.com/users/bfontaine/followers","following_url":"https://api.github.com/users/bfontaine/following{/other_user}","gists_url":"https://api.github.com/users/bfontaine/gists{/gist_id}","starred_url":"https://api.github.com/users/bfontaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfontaine/subscriptions","organizations_url":"https://api.github.com/users/bfontaine/orgs","repos_url":"https://api.github.com/users/bfontaine/repos","events_url":"https://api.github.com/users/bfontaine/events{/privacy}","received_events_url":"https://api.github.com/users/bfontaine/received_events","type":"User","site_admin":false},"body":"Use string interpolation instead of concatenation, e.g. `\"#{$1}www...#{$3[0]}...\"` instead of `$1 + \"www...\" + $3[0] + \"...\"`.","created_at":"2015-08-14T21:34:28Z","updated_at":"2015-08-14T21:34:28Z","html_url":"https://github.com/Homebrew/homebrew/pull/42955#discussion_r37121748","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/37121748"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/42955#discussion_r37121748"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955","id":42498098,"html_url":"https://github.com/Homebrew/homebrew/pull/42955","diff_url":"https://github.com/Homebrew/homebrew/pull/42955.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/42955.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42955","number":42955,"state":"open","locked":false,"title":"SourceForge DownloadStrategy HTTPS URL rewrite proposal #42953","user":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"body":"As discussed in ticket https://github.com/Homebrew/homebrew/issues/42953","created_at":"2015-08-14T21:08:37Z","updated_at":"2015-08-14T21:34:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66152f0f482bb7620421cdc03c4edf321814d35e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42955/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/84f86a095bfe91425bbdc5a6fa67b7cdc565f71b","head":{"label":"smarek:sourceforge-download-strategy","ref":"sourceforge-download-strategy","sha":"84f86a095bfe91425bbdc5a6fa67b7cdc565f71b","user":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"repo":{"id":40734254,"name":"homebrew","full_name":"smarek/homebrew","owner":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smarek/homebrew","description":":beer: The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/smarek/homebrew","forks_url":"https://api.github.com/repos/smarek/homebrew/forks","keys_url":"https://api.github.com/repos/smarek/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smarek/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smarek/homebrew/teams","hooks_url":"https://api.github.com/repos/smarek/homebrew/hooks","issue_events_url":"https://api.github.com/repos/smarek/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/smarek/homebrew/events","assignees_url":"https://api.github.com/repos/smarek/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/smarek/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/smarek/homebrew/tags","blobs_url":"https://api.github.com/repos/smarek/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smarek/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smarek/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/smarek/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smarek/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/smarek/homebrew/languages","stargazers_url":"https://api.github.com/repos/smarek/homebrew/stargazers","contributors_url":"https://api.github.com/repos/smarek/homebrew/contributors","subscribers_url":"https://api.github.com/repos/smarek/homebrew/subscribers","subscription_url":"https://api.github.com/repos/smarek/homebrew/subscription","commits_url":"https://api.github.com/repos/smarek/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/smarek/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/smarek/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/smarek/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/smarek/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/smarek/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smarek/homebrew/merges","archive_url":"https://api.github.com/repos/smarek/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smarek/homebrew/downloads","issues_url":"https://api.github.com/repos/smarek/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/smarek/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/smarek/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/smarek/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smarek/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/smarek/homebrew/releases{/id}","created_at":"2015-08-14T20:15:24Z","updated_at":"2015-08-14T20:15:40Z","pushed_at":"2015-08-14T21:32:18Z","git_url":"git://github.com/smarek/homebrew.git","ssh_url":"git@github.com:smarek/homebrew.git","clone_url":"https://github.com/smarek/homebrew.git","svn_url":"https://github.com/smarek/homebrew","homepage":"http://brew.sh","size":1592375,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"69fa261ece678f63bf428c6b86cd7aba4a576928","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":":beer: The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2015-08-14T20:47:39Z","pushed_at":"2015-08-14T21:32:21Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1592375,"stargazers_count":24640,"watchers_count":24640,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":12379,"mirror_url":null,"open_issues_count":394,"forks":12379,"open_issues":394,"watchers":24640,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/42955"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/42955"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/42955/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42955/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/84f86a095bfe91425bbdc5a6fa67b7cdc565f71b"}}}}