{"action":"created","comment":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments/128395202","pull_request_review_id":51070865,"id":128395202,"diff_hunk":"@@ -0,0 +1,131 @@\n+﻿// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+using NuGetGallery.RequestModels;\n+using System;\n+using System.IO;\n+using System.Net;\n+using System.Text.RegularExpressions;\n+using System.Web;\n+\n+namespace NuGetGallery.Helpers\n+{\n+    internal static class ReadMeHelper\n+    {\n+\n+        public const string ReadMeTypeUrl = \"Url\";\n+        public const string ReadMeTypeFile = \"File\";\n+        public const string ReadMeTypeWritten = \"Written\";\n+\n+        /// <summary>\n+        /// Returns if posted package form contains a ReadMe.\n+        /// </summary>\n+        /// <param name=\"formData\">A ReadMeRequest with the ReadMe data from the form.</param>\n+        /// <returns>Whether there is a ReadMe to upload.</returns>\n+        public static Boolean HasReadMe(ReadMeRequest formData)\n+        {\n+            switch (formData?.ReadMeType)\n+            {\n+                case ReadMeTypeUrl:\n+                    var readMeUrl = formData.ReadMeUrl;\n+                    var pattern = @\"^(((ht|f)tp(s?))\\:\\/\\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\\-\\.]+\\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\\:[0-9]+)*(\\/($|[a-zA-Z0-9\\.\\,\\;\\?\\'\\\\\\+&amp;%\\$#\\=~_\\-]+))*$\";\n+                    bool isValidUrl = Regex.IsMatch(readMeUrl, pattern);","path":"src/NuGetGallery/Helpers/ReadMeHelper.cs","position":32,"original_position":32,"commit_id":"f9c098af6eb448af2c3e2ebe49828a2508ef1c7b","original_commit_id":"f9c098af6eb448af2c3e2ebe49828a2508ef1c7b","user":{"login":"scottbommarito","id":18014088,"avatar_url":"https://avatars3.githubusercontent.com/u/18014088?v=4","gravatar_id":"","url":"https://api.github.com/users/scottbommarito","html_url":"https://github.com/scottbommarito","followers_url":"https://api.github.com/users/scottbommarito/followers","following_url":"https://api.github.com/users/scottbommarito/following{/other_user}","gists_url":"https://api.github.com/users/scottbommarito/gists{/gist_id}","starred_url":"https://api.github.com/users/scottbommarito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottbommarito/subscriptions","organizations_url":"https://api.github.com/users/scottbommarito/orgs","repos_url":"https://api.github.com/users/scottbommarito/repos","events_url":"https://api.github.com/users/scottbommarito/events{/privacy}","received_events_url":"https://api.github.com/users/scottbommarito/received_events","type":"User","site_admin":false},"body":"I tried this before, IIS blocks files with a type of .config, even on localhost.","created_at":"2017-07-19T23:41:48Z","updated_at":"2017-07-19T23:41:48Z","html_url":"https://github.com/NuGet/NuGetGallery/pull/4412#discussion_r128395202","pull_request_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412","_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments/128395202"},"html":{"href":"https://github.com/NuGet/NuGetGallery/pull/4412#discussion_r128395202"},"pull_request":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412"}}},"pull_request":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412","id":131188487,"html_url":"https://github.com/NuGet/NuGetGallery/pull/4412","diff_url":"https://github.com/NuGet/NuGetGallery/pull/4412.diff","patch_url":"https://github.com/NuGet/NuGetGallery/pull/4412.patch","issue_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4412","number":4412,"state":"open","locked":false,"title":"Feature larose","user":{"login":"fayrose","id":20001456,"avatar_url":"https://avatars1.githubusercontent.com/u/20001456?v=4","gravatar_id":"","url":"https://api.github.com/users/fayrose","html_url":"https://github.com/fayrose","followers_url":"https://api.github.com/users/fayrose/followers","following_url":"https://api.github.com/users/fayrose/following{/other_user}","gists_url":"https://api.github.com/users/fayrose/gists{/gist_id}","starred_url":"https://api.github.com/users/fayrose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fayrose/subscriptions","organizations_url":"https://api.github.com/users/fayrose/orgs","repos_url":"https://api.github.com/users/fayrose/repos","events_url":"https://api.github.com/users/fayrose/events{/privacy}","received_events_url":"https://api.github.com/users/fayrose/received_events","type":"User","site_admin":false},"body":"Added Repository URL field in _EditMetaData.cshtml:\r\n![image](https://user-images.githubusercontent.com/20001456/28339908-a94cbfb0-6bc2-11e7-9b7d-bb6ec48e574e.png)\r\n\r\nAdded collapsible ReadMe section:\r\n![image](https://user-images.githubusercontent.com/20001456/28339939-d0931fa6-6bc2-11e7-9a76-ba638bbe2c60.png)\r\n\r\nReadMe Error:\r\n![image](https://user-images.githubusercontent.com/20001456/28339966-e662a662-6bc2-11e7-9054-c78b52c771c0.png)\r\n\r\nPreviewing a ReadMe in the upload page:\r\n![image](https://user-images.githubusercontent.com/20001456/28340011-17b27f08-6bc3-11e7-9456-1a8b97aa037d.png)\r\n\r\nPlease note that all of the above are for the upload scenario, and not for the edit scenario.\r\n","created_at":"2017-07-18T21:13:09Z","updated_at":"2017-07-19T23:41:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d219a62d1b7c82861cbcfd2dba90a29a4c63af0f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412/commits","review_comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412/comments","review_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4412/comments","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/f9c098af6eb448af2c3e2ebe49828a2508ef1c7b","head":{"label":"NuGet:feature-larose","ref":"feature-larose","sha":"f9c098af6eb448af2c3e2ebe49828a2508ef1c7b","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars2.githubusercontent.com/u/968310?v=4","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":2180736,"name":"NuGetGallery","full_name":"NuGet/NuGetGallery","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars2.githubusercontent.com/u/968310?v=4","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGetGallery","description":"The NuGet Gallery","fork":false,"url":"https://api.github.com/repos/NuGet/NuGetGallery","forks_url":"https://api.github.com/repos/NuGet/NuGetGallery/forks","keys_url":"https://api.github.com/repos/NuGet/NuGetGallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGetGallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGetGallery/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGetGallery/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGetGallery/events","assignees_url":"https://api.github.com/repos/NuGet/NuGetGallery/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGetGallery/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGetGallery/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGetGallery/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGetGallery/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGetGallery/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGetGallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGetGallery/merges","archive_url":"https://api.github.com/repos/NuGet/NuGetGallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGetGallery/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGetGallery/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGetGallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGetGallery/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGetGallery/releases{/id}","deployments_url":"https://api.github.com/repos/NuGet/NuGetGallery/deployments","created_at":"2011-08-09T17:57:32Z","updated_at":"2017-07-19T15:57:27Z","pushed_at":"2017-07-19T22:17:37Z","git_url":"git://github.com/NuGet/NuGetGallery.git","ssh_url":"git@github.com:NuGet/NuGetGallery.git","clone_url":"https://github.com/NuGet/NuGetGallery.git","svn_url":"https://github.com/NuGet/NuGetGallery","homepage":"http://www.nuget.org","size":42554,"stargazers_count":881,"watchers_count":881,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":501,"mirror_url":null,"open_issues_count":354,"forks":501,"open_issues":354,"watchers":881,"default_branch":"master"}},"base":{"label":"NuGet:feature-nuggets","ref":"feature-nuggets","sha":"7e582d71648481b64b53fddd42d9e9df9788cdb2","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars2.githubusercontent.com/u/968310?v=4","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":2180736,"name":"NuGetGallery","full_name":"NuGet/NuGetGallery","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars2.githubusercontent.com/u/968310?v=4","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGetGallery","description":"The NuGet Gallery","fork":false,"url":"https://api.github.com/repos/NuGet/NuGetGallery","forks_url":"https://api.github.com/repos/NuGet/NuGetGallery/forks","keys_url":"https://api.github.com/repos/NuGet/NuGetGallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGetGallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGetGallery/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGetGallery/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGetGallery/events","assignees_url":"https://api.github.com/repos/NuGet/NuGetGallery/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGetGallery/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGetGallery/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGetGallery/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGetGallery/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGetGallery/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGetGallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGetGallery/merges","archive_url":"https://api.github.com/repos/NuGet/NuGetGallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGetGallery/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGetGallery/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGetGallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGetGallery/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGetGallery/releases{/id}","deployments_url":"https://api.github.com/repos/NuGet/NuGetGallery/deployments","created_at":"2011-08-09T17:57:32Z","updated_at":"2017-07-19T15:57:27Z","pushed_at":"2017-07-19T22:17:37Z","git_url":"git://github.com/NuGet/NuGetGallery.git","ssh_url":"git@github.com:NuGet/NuGetGallery.git","clone_url":"https://github.com/NuGet/NuGetGallery.git","svn_url":"https://github.com/NuGet/NuGetGallery","homepage":"http://www.nuget.org","size":42554,"stargazers_count":881,"watchers_count":881,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":501,"mirror_url":null,"open_issues_count":354,"forks":501,"open_issues":354,"watchers":881,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412"},"html":{"href":"https://github.com/NuGet/NuGetGallery/pull/4412"},"issue":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4412"},"comments":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4412/comments"},"review_comments":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412/comments"},"review_comment":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4412/commits"},"statuses":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/f9c098af6eb448af2c3e2ebe49828a2508ef1c7b"}}}}
{"actor":{"display_login":"scottbommarito"}}