{"action":"created","comment":{"url":"https://api.github.com/repos/txtdirect/txtdirect/pulls/comments/210911479","pull_request_review_id":147228514,"id":210911479,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDkxMTQ3OQ==","diff_hunk":"@@ -3,22 +3,31 @@ package txtdirect\n import (\n \t\"context\"\n \t\"fmt\"\n+\t\"log\"\n \t\"net\"\n \t\"regexp\"\n \t\"sort\"\n \t\"strconv\"\n \t\"strings\"\n+\t\"time\"\n )\n \n var PathRegex = regexp.MustCompile(\"\\\\/([A-Za-z0-9-._~!$'()*+,;=:@]+)\")\n var FromRegex = regexp.MustCompile(\"\\\\/\\\\$(\\\\d+)\")\n \n func zoneFromPath(host string, path string, rec record) (string, int, error) {\n \tpathSubmatchs := PathRegex.FindAllStringSubmatch(path, -1)\n+\tif rec.Re != \"\" {\n+\t\tCustomRegex := regexp.MustCompile(rec.Re)","path":"path.go","position":19,"original_position":19,"commit_id":"ee158283258b599925d9981523a0478ac07797fe","original_commit_id":"ee158283258b599925d9981523a0478ac07797fe","user":{"login":"alarsyo","id":15170378,"node_id":"MDQ6VXNlcjE1MTcwMzc4","avatar_url":"https://avatars2.githubusercontent.com/u/15170378?v=4","gravatar_id":"","url":"https://api.github.com/users/alarsyo","html_url":"https://github.com/alarsyo","followers_url":"https://api.github.com/users/alarsyo/followers","following_url":"https://api.github.com/users/alarsyo/following{/other_user}","gists_url":"https://api.github.com/users/alarsyo/gists{/gist_id}","starred_url":"https://api.github.com/users/alarsyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alarsyo/subscriptions","organizations_url":"https://api.github.com/users/alarsyo/orgs","repos_url":"https://api.github.com/users/alarsyo/repos","events_url":"https://api.github.com/users/alarsyo/events{/privacy}","received_events_url":"https://api.github.com/users/alarsyo/received_events","type":"User","site_admin":false},"body":"We might want to use `regex.Compile` here and check for the error, otherwise a badly crafted regex could crash the server","created_at":"2018-08-17T13:38:01Z","updated_at":"2018-08-17T13:44:57Z","html_url":"https://github.com/txtdirect/txtdirect/pull/94#discussion_r210911479","pull_request_url":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/txtdirect/txtdirect/pulls/comments/210911479"},"html":{"href":"https://github.com/txtdirect/txtdirect/pull/94#discussion_r210911479"},"pull_request":{"href":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94","id":208911135,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4OTExMTM1","html_url":"https://github.com/txtdirect/txtdirect/pull/94","diff_url":"https://github.com/txtdirect/txtdirect/pull/94.diff","patch_url":"https://github.com/txtdirect/txtdirect/pull/94.patch","issue_url":"https://api.github.com/repos/txtdirect/txtdirect/issues/94","number":94,"state":"open","locked":false,"title":"Implement custom regex for path","user":{"login":"erbesharat","id":7544732,"node_id":"MDQ6VXNlcjc1NDQ3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/7544732?v=4","gravatar_id":"","url":"https://api.github.com/users/erbesharat","html_url":"https://github.com/erbesharat","followers_url":"https://api.github.com/users/erbesharat/followers","following_url":"https://api.github.com/users/erbesharat/following{/other_user}","gists_url":"https://api.github.com/users/erbesharat/gists{/gist_id}","starred_url":"https://api.github.com/users/erbesharat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erbesharat/subscriptions","organizations_url":"https://api.github.com/users/erbesharat/orgs","repos_url":"https://api.github.com/users/erbesharat/repos","events_url":"https://api.github.com/users/erbesharat/events{/privacy}","received_events_url":"https://api.github.com/users/erbesharat/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\nImplements custom regex option for parsing path\r\n\r\n**Which issue this PR fixes**:\r\nfixes #51 \r\n\r\n\r\n**Special notes for your reviewer**:\r\nThe last example in the issue needs more thinking. will find a solution for that later. **(WIP)**","created_at":"2018-08-16T16:10:20Z","updated_at":"2018-08-17T13:44:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2ea531f9e403c16d336d3a8669ba42a18aacc79","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dbriesz","id":20975751,"node_id":"MDQ6VXNlcjIwOTc1NzUx","avatar_url":"https://avatars1.githubusercontent.com/u/20975751?v=4","gravatar_id":"","url":"https://api.github.com/users/dbriesz","html_url":"https://github.com/dbriesz","followers_url":"https://api.github.com/users/dbriesz/followers","following_url":"https://api.github.com/users/dbriesz/following{/other_user}","gists_url":"https://api.github.com/users/dbriesz/gists{/gist_id}","starred_url":"https://api.github.com/users/dbriesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbriesz/subscriptions","organizations_url":"https://api.github.com/users/dbriesz/orgs","repos_url":"https://api.github.com/users/dbriesz/repos","events_url":"https://api.github.com/users/dbriesz/events{/privacy}","received_events_url":"https://api.github.com/users/dbriesz/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94/commits","review_comments_url":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94/comments","review_comment_url":"https://api.github.com/repos/txtdirect/txtdirect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/txtdirect/txtdirect/issues/94/comments","statuses_url":"https://api.github.com/repos/txtdirect/txtdirect/statuses/ee158283258b599925d9981523a0478ac07797fe","head":{"label":"erbesharat:implement/custom-regex","ref":"implement/custom-regex","sha":"ee158283258b599925d9981523a0478ac07797fe","user":{"login":"erbesharat","id":7544732,"node_id":"MDQ6VXNlcjc1NDQ3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/7544732?v=4","gravatar_id":"","url":"https://api.github.com/users/erbesharat","html_url":"https://github.com/erbesharat","followers_url":"https://api.github.com/users/erbesharat/followers","following_url":"https://api.github.com/users/erbesharat/following{/other_user}","gists_url":"https://api.github.com/users/erbesharat/gists{/gist_id}","starred_url":"https://api.github.com/users/erbesharat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erbesharat/subscriptions","organizations_url":"https://api.github.com/users/erbesharat/orgs","repos_url":"https://api.github.com/users/erbesharat/repos","events_url":"https://api.github.com/users/erbesharat/events{/privacy}","received_events_url":"https://api.github.com/users/erbesharat/received_events","type":"User","site_admin":false},"repo":{"id":116850137,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY4NTAxMzc=","name":"txtdirect","full_name":"erbesharat/txtdirect","owner":{"login":"erbesharat","id":7544732,"node_id":"MDQ6VXNlcjc1NDQ3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/7544732?v=4","gravatar_id":"","url":"https://api.github.com/users/erbesharat","html_url":"https://github.com/erbesharat","followers_url":"https://api.github.com/users/erbesharat/followers","following_url":"https://api.github.com/users/erbesharat/following{/other_user}","gists_url":"https://api.github.com/users/erbesharat/gists{/gist_id}","starred_url":"https://api.github.com/users/erbesharat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erbesharat/subscriptions","organizations_url":"https://api.github.com/users/erbesharat/orgs","repos_url":"https://api.github.com/users/erbesharat/repos","events_url":"https://api.github.com/users/erbesharat/events{/privacy}","received_events_url":"https://api.github.com/users/erbesharat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erbesharat/txtdirect","description":"DNS TXT-record based redirects","fork":true,"url":"https://api.github.com/repos/erbesharat/txtdirect","forks_url":"https://api.github.com/repos/erbesharat/txtdirect/forks","keys_url":"https://api.github.com/repos/erbesharat/txtdirect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erbesharat/txtdirect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erbesharat/txtdirect/teams","hooks_url":"https://api.github.com/repos/erbesharat/txtdirect/hooks","issue_events_url":"https://api.github.com/repos/erbesharat/txtdirect/issues/events{/number}","events_url":"https://api.github.com/repos/erbesharat/txtdirect/events","assignees_url":"https://api.github.com/repos/erbesharat/txtdirect/assignees{/user}","branches_url":"https://api.github.com/repos/erbesharat/txtdirect/branches{/branch}","tags_url":"https://api.github.com/repos/erbesharat/txtdirect/tags","blobs_url":"https://api.github.com/repos/erbesharat/txtdirect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erbesharat/txtdirect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erbesharat/txtdirect/git/refs{/sha}","trees_url":"https://api.github.com/repos/erbesharat/txtdirect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erbesharat/txtdirect/statuses/{sha}","languages_url":"https://api.github.com/repos/erbesharat/txtdirect/languages","stargazers_url":"https://api.github.com/repos/erbesharat/txtdirect/stargazers","contributors_url":"https://api.github.com/repos/erbesharat/txtdirect/contributors","subscribers_url":"https://api.github.com/repos/erbesharat/txtdirect/subscribers","subscription_url":"https://api.github.com/repos/erbesharat/txtdirect/subscription","commits_url":"https://api.github.com/repos/erbesharat/txtdirect/commits{/sha}","git_commits_url":"https://api.github.com/repos/erbesharat/txtdirect/git/commits{/sha}","comments_url":"https://api.github.com/repos/erbesharat/txtdirect/comments{/number}","issue_comment_url":"https://api.github.com/repos/erbesharat/txtdirect/issues/comments{/number}","contents_url":"https://api.github.com/repos/erbesharat/txtdirect/contents/{+path}","compare_url":"https://api.github.com/repos/erbesharat/txtdirect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erbesharat/txtdirect/merges","archive_url":"https://api.github.com/repos/erbesharat/txtdirect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erbesharat/txtdirect/downloads","issues_url":"https://api.github.com/repos/erbesharat/txtdirect/issues{/number}","pulls_url":"https://api.github.com/repos/erbesharat/txtdirect/pulls{/number}","milestones_url":"https://api.github.com/repos/erbesharat/txtdirect/milestones{/number}","notifications_url":"https://api.github.com/repos/erbesharat/txtdirect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erbesharat/txtdirect/labels{/name}","releases_url":"https://api.github.com/repos/erbesharat/txtdirect/releases{/id}","deployments_url":"https://api.github.com/repos/erbesharat/txtdirect/deployments","created_at":"2018-01-09T17:48:08Z","updated_at":"2018-08-08T16:08:51Z","pushed_at":"2018-08-16T15:46:50Z","git_url":"git://github.com/erbesharat/txtdirect.git","ssh_url":"git@github.com:erbesharat/txtdirect.git","clone_url":"https://github.com/erbesharat/txtdirect.git","svn_url":"https://github.com/erbesharat/txtdirect","homepage":"https://about.txtdirect.org","size":170,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"txtdirect:master","ref":"master","sha":"761c04d98fb2c03763355cfa9d6135628c8918dd","user":{"login":"txtdirect","id":29709653,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5NzA5NjUz","avatar_url":"https://avatars1.githubusercontent.com/u/29709653?v=4","gravatar_id":"","url":"https://api.github.com/users/txtdirect","html_url":"https://github.com/txtdirect","followers_url":"https://api.github.com/users/txtdirect/followers","following_url":"https://api.github.com/users/txtdirect/following{/other_user}","gists_url":"https://api.github.com/users/txtdirect/gists{/gist_id}","starred_url":"https://api.github.com/users/txtdirect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/txtdirect/subscriptions","organizations_url":"https://api.github.com/users/txtdirect/orgs","repos_url":"https://api.github.com/users/txtdirect/repos","events_url":"https://api.github.com/users/txtdirect/events{/privacy}","received_events_url":"https://api.github.com/users/txtdirect/received_events","type":"Organization","site_admin":false},"repo":{"id":100856271,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA4NTYyNzE=","name":"txtdirect","full_name":"txtdirect/txtdirect","owner":{"login":"txtdirect","id":29709653,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5NzA5NjUz","avatar_url":"https://avatars1.githubusercontent.com/u/29709653?v=4","gravatar_id":"","url":"https://api.github.com/users/txtdirect","html_url":"https://github.com/txtdirect","followers_url":"https://api.github.com/users/txtdirect/followers","following_url":"https://api.github.com/users/txtdirect/following{/other_user}","gists_url":"https://api.github.com/users/txtdirect/gists{/gist_id}","starred_url":"https://api.github.com/users/txtdirect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/txtdirect/subscriptions","organizations_url":"https://api.github.com/users/txtdirect/orgs","repos_url":"https://api.github.com/users/txtdirect/repos","events_url":"https://api.github.com/users/txtdirect/events{/privacy}","received_events_url":"https://api.github.com/users/txtdirect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/txtdirect/txtdirect","description":"DNS TXT-record based redirects","fork":false,"url":"https://api.github.com/repos/txtdirect/txtdirect","forks_url":"https://api.github.com/repos/txtdirect/txtdirect/forks","keys_url":"https://api.github.com/repos/txtdirect/txtdirect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/txtdirect/txtdirect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/txtdirect/txtdirect/teams","hooks_url":"https://api.github.com/repos/txtdirect/txtdirect/hooks","issue_events_url":"https://api.github.com/repos/txtdirect/txtdirect/issues/events{/number}","events_url":"https://api.github.com/repos/txtdirect/txtdirect/events","assignees_url":"https://api.github.com/repos/txtdirect/txtdirect/assignees{/user}","branches_url":"https://api.github.com/repos/txtdirect/txtdirect/branches{/branch}","tags_url":"https://api.github.com/repos/txtdirect/txtdirect/tags","blobs_url":"https://api.github.com/repos/txtdirect/txtdirect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/txtdirect/txtdirect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/txtdirect/txtdirect/git/refs{/sha}","trees_url":"https://api.github.com/repos/txtdirect/txtdirect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/txtdirect/txtdirect/statuses/{sha}","languages_url":"https://api.github.com/repos/txtdirect/txtdirect/languages","stargazers_url":"https://api.github.com/repos/txtdirect/txtdirect/stargazers","contributors_url":"https://api.github.com/repos/txtdirect/txtdirect/contributors","subscribers_url":"https://api.github.com/repos/txtdirect/txtdirect/subscribers","subscription_url":"https://api.github.com/repos/txtdirect/txtdirect/subscription","commits_url":"https://api.github.com/repos/txtdirect/txtdirect/commits{/sha}","git_commits_url":"https://api.github.com/repos/txtdirect/txtdirect/git/commits{/sha}","comments_url":"https://api.github.com/repos/txtdirect/txtdirect/comments{/number}","issue_comment_url":"https://api.github.com/repos/txtdirect/txtdirect/issues/comments{/number}","contents_url":"https://api.github.com/repos/txtdirect/txtdirect/contents/{+path}","compare_url":"https://api.github.com/repos/txtdirect/txtdirect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/txtdirect/txtdirect/merges","archive_url":"https://api.github.com/repos/txtdirect/txtdirect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/txtdirect/txtdirect/downloads","issues_url":"https://api.github.com/repos/txtdirect/txtdirect/issues{/number}","pulls_url":"https://api.github.com/repos/txtdirect/txtdirect/pulls{/number}","milestones_url":"https://api.github.com/repos/txtdirect/txtdirect/milestones{/number}","notifications_url":"https://api.github.com/repos/txtdirect/txtdirect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/txtdirect/txtdirect/labels{/name}","releases_url":"https://api.github.com/repos/txtdirect/txtdirect/releases{/id}","deployments_url":"https://api.github.com/repos/txtdirect/txtdirect/deployments","created_at":"2017-08-20T11:13:30Z","updated_at":"2018-08-15T08:31:59Z","pushed_at":"2018-08-17T13:27:14Z","git_url":"git://github.com/txtdirect/txtdirect.git","ssh_url":"git@github.com:txtdirect/txtdirect.git","clone_url":"https://github.com/txtdirect/txtdirect.git","svn_url":"https://github.com/txtdirect/txtdirect","homepage":"https://about.txtdirect.org","size":172,"stargazers_count":15,"watchers_count":15,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4,"open_issues":12,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94"},"html":{"href":"https://github.com/txtdirect/txtdirect/pull/94"},"issue":{"href":"https://api.github.com/repos/txtdirect/txtdirect/issues/94"},"comments":{"href":"https://api.github.com/repos/txtdirect/txtdirect/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/txtdirect/txtdirect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/txtdirect/txtdirect/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/txtdirect/txtdirect/statuses/ee158283258b599925d9981523a0478ac07797fe"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"alarsyo"}}