{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/comments/26601579","id":26601579,"diff_hunk":"@@ -57,6 +57,11 @@ unauthenticatedRoutes = [\n \t\tmethod: 'GET',\n \t\tpath: localSettings.apiBase + '/search/{query}',\n \t\thandler: require('./facets/api/search').get\n+\t},\n+\t{\n+\t\tmethod: 'POST',\n+\t\tpath: '/editor_preview/',","path":"server/routes.ts","position":7,"original_position":7,"commit_id":"264f7592db29e02c2cc43e2ce2a1ac3b36d17c23","original_commit_id":"264f7592db29e02c2cc43e2ce2a1ac3b36d17c23","user":{"login":"kenkouot","id":2964310,"avatar_url":"https://avatars.githubusercontent.com/u/2964310?v=3","gravatar_id":"","url":"https://api.github.com/users/kenkouot","html_url":"https://github.com/kenkouot","followers_url":"https://api.github.com/users/kenkouot/followers","following_url":"https://api.github.com/users/kenkouot/following{/other_user}","gists_url":"https://api.github.com/users/kenkouot/gists{/gist_id}","starred_url":"https://api.github.com/users/kenkouot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenkouot/subscriptions","organizations_url":"https://api.github.com/users/kenkouot/orgs","repos_url":"https://api.github.com/users/kenkouot/repos","events_url":"https://api.github.com/users/kenkouot/events{/privacy}","received_events_url":"https://api.github.com/users/kenkouot/received_events","type":"User","site_admin":false},"body":"I'm unsure on the snake_case here. @hakubo on the front end, we have camelCase for query params. We need to decide now on a casing for our exposed URIs (api and application). I prefer snake_case personally as it is case insensitive but still have delimiters for spaces. If we change that, I'd prefer to change our the `camelCase` query params in the Ember routing too.\r\n\r\nSo, snake_case everywhere?","created_at":"2015-03-17T18:30:12Z","updated_at":"2015-03-17T18:30:12Z","html_url":"https://github.com/Wikia/mercury/pull/618#discussion_r26601579","pull_request_url":"https://api.github.com/repos/Wikia/mercury/pulls/618","_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments/26601579"},"html":{"href":"https://github.com/Wikia/mercury/pull/618#discussion_r26601579"},"pull_request":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/618"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/618","id":31355395,"html_url":"https://github.com/Wikia/mercury/pull/618","diff_url":"https://github.com/Wikia/mercury/pull/618.diff","patch_url":"https://github.com/Wikia/mercury/pull/618.patch","issue_url":"https://api.github.com/repos/Wikia/mercury/issues/618","number":618,"state":"open","locked":false,"title":"CE-1431 Added /editor_preview/ route to preview given HTML in Mercury skin","user":{"login":"gabrys","id":74567,"avatar_url":"https://avatars.githubusercontent.com/u/74567?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrys","html_url":"https://github.com/gabrys","followers_url":"https://api.github.com/users/gabrys/followers","following_url":"https://api.github.com/users/gabrys/following{/other_user}","gists_url":"https://api.github.com/users/gabrys/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrys/subscriptions","organizations_url":"https://api.github.com/users/gabrys/orgs","repos_url":"https://api.github.com/users/gabrys/repos","events_url":"https://api.github.com/users/gabrys/events{/privacy}","received_events_url":"https://api.github.com/users/gabrys/received_events","type":"User","site_admin":false},"body":"This pull requests adds capability to preview an HTML in a Mercury skin.\r\n\r\nThe API is: POST /editor_preview/ the POST params are:\r\n\r\n* parserOutput: JSON as returned by ArticleApi (article as JSON)\r\n* title: article title\r\n* mwHash: sha1 hash with salt to prove the parserOutput was indeed generated by MediaWiki\r\n\r\nThis commit reveals an issue of not properly encoding article title passed by MediaWiki API in https://github.com/Wikia/mercury/pull/618/files#diff-5a151be511cd8e3c3d6a4e795aad8d46R120 . We chose to fix this issue on the MediaWiki side https://wikia-inc.atlassian.net/browse/HG-564, but I would like us to revisit this issue and move the fix to Mercury, so everything works as expected.\r\n\r\nThe salt for recomputing mwHash is expected to appear as an environmental variable MW_PREVIEW_SALT.\r\n\r\nAt one point, we might want to simplify the whole flow by making /editor_preview/ accepting wiki text to parse instead of parsed HTML, but now it would mean crossing multiple layers between Mercury and MW Parser (the mwHash becomes useless then).","created_at":"2015-03-17T17:01:53Z","updated_at":"2015-03-17T18:30:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"117948c270764c906fc173b124a0a286d8bf4158","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/mercury/pulls/618/commits","review_comments_url":"https://api.github.com/repos/Wikia/mercury/pulls/618/comments","review_comment_url":"https://api.github.com/repos/Wikia/mercury/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/mercury/issues/618/comments","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/264f7592db29e02c2cc43e2ce2a1ac3b36d17c23","head":{"label":"Wikia:ce-1431-mercury-preview","ref":"ce-1431-mercury-preview","sha":"264f7592db29e02c2cc43e2ce2a1ac3b36d17c23","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","created_at":"2014-02-10T21:44:25Z","updated_at":"2015-03-17T12:04:02Z","pushed_at":"2015-03-17T17:01:45Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"http://dev.wikia.com","size":16704,"stargazers_count":9,"watchers_count":9,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":9,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"af7d05166667dc356f5f1a0f37a7c654dee5322d","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","created_at":"2014-02-10T21:44:25Z","updated_at":"2015-03-17T12:04:02Z","pushed_at":"2015-03-17T17:01:45Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"http://dev.wikia.com","size":16704,"stargazers_count":9,"watchers_count":9,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":9,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/618"},"html":{"href":"https://github.com/Wikia/mercury/pull/618"},"issue":{"href":"https://api.github.com/repos/Wikia/mercury/issues/618"},"comments":{"href":"https://api.github.com/repos/Wikia/mercury/issues/618/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/618/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/618/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/mercury/statuses/264f7592db29e02c2cc43e2ce2a1ac3b36d17c23"}}}}