{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/comments/175358004","pull_request_review_id":104871095,"id":175358004,"diff_hunk":"@@ -72,6 +77,41 @@ func dataVisHandler(w http.ResponseWriter, req *http.Request) {\n }\n \n func apiHandler(w http.ResponseWriter, req *http.Request) {\n+\tlog.DebugR(req, \"returning api help text\", log.Data{\n+\t\t\"host\": req.Host,\n+\t\t\"path\": req.URL.Path,\n+\t})\n \tw.WriteHeader(410)\n \tw.Write([]byte(apiResponse))\n }\n+\n+func visualAssetHandler(w http.ResponseWriter, req *http.Request) {\n+\tdest := \"https://static.ons.gov.uk/visual/\" + mux.Vars(req)[\"uri\"]\n+\tlog.DebugR(req, \"redirecting visual.ons.gov.uk wp-content\", log.Data{\n+\t\t\"host\": req.Host,\n+\t\t\"path\": req.URL.Path,\n+\t\t\"dest\": dest,\n+\t})\n+\tw.Header().Set(\"Location\", dest)\n+\tw.WriteHeader(redir)\n+}\n+\n+func visualArticleHandler(w http.ResponseWriter, req *http.Request) {\n+\tarticle := mux.Vars(req)[\"article\"]\n+\turi := mux.Vars(req)[\"uri\"]\n+\tlog.DebugR(req, \"redirecting visual.ons.gov.uk\", log.Data{\n+\t\t\"article\": article,\n+\t\t\"uri\":     uri,\n+\t\t\"host\":    req.Host,\n+\t\t\"path\":    req.URL.Path,\n+\t})\n+\n+\tif dest, ok := visualRedirects[article]; ok {","path":"main.go","position":null,"original_position":75,"commit_id":"57a41ca336b1861f6b334f609be75ee3c16ad713","original_commit_id":"315931a4abed7ae7e0d160ec04de918751e09ac4","user":{"login":"daiLlew","id":14196957,"avatar_url":"https://avatars3.githubusercontent.com/u/14196957?v=4","gravatar_id":"","url":"https://api.github.com/users/daiLlew","html_url":"https://github.com/daiLlew","followers_url":"https://api.github.com/users/daiLlew/followers","following_url":"https://api.github.com/users/daiLlew/following{/other_user}","gists_url":"https://api.github.com/users/daiLlew/gists{/gist_id}","starred_url":"https://api.github.com/users/daiLlew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daiLlew/subscriptions","organizations_url":"https://api.github.com/users/daiLlew/orgs","repos_url":"https://api.github.com/users/daiLlew/repos","events_url":"https://api.github.com/users/daiLlew/events{/privacy}","received_events_url":"https://api.github.com/users/daiLlew/received_events","type":"User","site_admin":false},"body":"Add a log message here to say redirect was identified.","created_at":"2018-03-19T08:31:33Z","updated_at":"2018-03-19T08:31:37Z","html_url":"https://github.com/ONSdigital/dp-legacy-redirector/pull/2#discussion_r175358004","pull_request_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/comments/175358004"},"html":{"href":"https://github.com/ONSdigital/dp-legacy-redirector/pull/2#discussion_r175358004"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2","id":175830192,"html_url":"https://github.com/ONSdigital/dp-legacy-redirector/pull/2","diff_url":"https://github.com/ONSdigital/dp-legacy-redirector/pull/2.diff","patch_url":"https://github.com/ONSdigital/dp-legacy-redirector/pull/2.patch","issue_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/2","number":2,"state":"open","locked":false,"title":"Feature/visual redirects","user":{"login":"ian-kent","id":2300772,"avatar_url":"https://avatars3.githubusercontent.com/u/2300772?v=4","gravatar_id":"","url":"https://api.github.com/users/ian-kent","html_url":"https://github.com/ian-kent","followers_url":"https://api.github.com/users/ian-kent/followers","following_url":"https://api.github.com/users/ian-kent/following{/other_user}","gists_url":"https://api.github.com/users/ian-kent/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-kent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-kent/subscriptions","organizations_url":"https://api.github.com/users/ian-kent/orgs","repos_url":"https://api.github.com/users/ian-kent/repos","events_url":"https://api.github.com/users/ian-kent/events{/privacy}","received_events_url":"https://api.github.com/users/ian-kent/received_events","type":"User","site_admin":false},"body":"Add redirects for visual.ons.gov.uk","created_at":"2018-03-19T08:20:09Z","updated_at":"2018-03-19T08:31:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"112d975d4905deee9e5cbf5f6e54bda9a929fb64","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/2/comments","statuses_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/statuses/57a41ca336b1861f6b334f609be75ee3c16ad713","head":{"label":"ONSdigital:feature/visual-redirects","ref":"feature/visual-redirects","sha":"57a41ca336b1861f6b334f609be75ee3c16ad713","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":89496657,"name":"dp-legacy-redirector","full_name":"ONSdigital/dp-legacy-redirector","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/dp-legacy-redirector","description":"Redirector for legacy ONS services including NeSS, WDA and Visual.ONS","fork":false,"url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector","forks_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/forks","keys_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/teams","hooks_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/events","assignees_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/tags","blobs_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/subscription","commits_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/merges","archive_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/downloads","issues_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/deployments","created_at":"2017-04-26T15:23:38Z","updated_at":"2018-03-14T10:03:46Z","pushed_at":"2018-03-19T08:30:58Z","git_url":"git://github.com/ONSdigital/dp-legacy-redirector.git","ssh_url":"git@github.com:ONSdigital/dp-legacy-redirector.git","clone_url":"https://github.com/ONSdigital/dp-legacy-redirector.git","svn_url":"https://github.com/ONSdigital/dp-legacy-redirector","homepage":"","size":17,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"ONSdigital:develop","ref":"develop","sha":"8b58f545bfcfa46294adae293e0ada5eb33244ae","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":89496657,"name":"dp-legacy-redirector","full_name":"ONSdigital/dp-legacy-redirector","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/dp-legacy-redirector","description":"Redirector for legacy ONS services including NeSS, WDA and Visual.ONS","fork":false,"url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector","forks_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/forks","keys_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/teams","hooks_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/events","assignees_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/tags","blobs_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/subscription","commits_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/merges","archive_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/downloads","issues_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/deployments","created_at":"2017-04-26T15:23:38Z","updated_at":"2018-03-14T10:03:46Z","pushed_at":"2018-03-19T08:30:58Z","git_url":"git://github.com/ONSdigital/dp-legacy-redirector.git","ssh_url":"git@github.com:ONSdigital/dp-legacy-redirector.git","clone_url":"https://github.com/ONSdigital/dp-legacy-redirector.git","svn_url":"https://github.com/ONSdigital/dp-legacy-redirector","homepage":"","size":17,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2"},"html":{"href":"https://github.com/ONSdigital/dp-legacy-redirector/pull/2"},"issue":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/2"},"comments":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/dp-legacy-redirector/statuses/57a41ca336b1861f6b334f609be75ee3c16ad713"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"daiLlew"}}