{"action":"created","comment":{"url":"https://api.github.com/repos/thelounge/thelounge/pulls/comments/194990330","pull_request_review_id":128267084,"id":194990330,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDk5MDMzMA==","diff_hunk":"@@ -48,6 +50,50 @@ module.exports = function() {\n \t\t\tmaxAge: 86400 * 1000,\n \t\t}));\n \n+\tapp.get(\"/uploads/:file\", (req, res) => {\n+\t\tconst fileName = req.params.file;\n+\t\tconst uploadPath = Helper.getFileUploadPath();\n+\t\tconst contentType = mime.contentType(path.extname(fileName));\n+\t\tconst filePath = path.join(uploadPath, fileName);\n+\t\tconst uploadedFile = upload.ensureFileExists(filePath);","path":"src/server.js","position":23,"original_position":23,"commit_id":"98a5e18ae51b17ef79edce5a90bd4dc30d484cb1","original_commit_id":"98a5e18ae51b17ef79edce5a90bd4dc30d484cb1","user":{"login":"xPaw","id":613331,"node_id":"MDQ6VXNlcjYxMzMzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/613331?v=4","gravatar_id":"","url":"https://api.github.com/users/xPaw","html_url":"https://github.com/xPaw","followers_url":"https://api.github.com/users/xPaw/followers","following_url":"https://api.github.com/users/xPaw/following{/other_user}","gists_url":"https://api.github.com/users/xPaw/gists{/gist_id}","starred_url":"https://api.github.com/users/xPaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xPaw/subscriptions","organizations_url":"https://api.github.com/users/xPaw/orgs","repos_url":"https://api.github.com/users/xPaw/repos","events_url":"https://api.github.com/users/xPaw/events{/privacy}","received_events_url":"https://api.github.com/users/xPaw/received_events","type":"User","site_admin":false},"body":"Just use `fs.existsSync` directly","created_at":"2018-06-13T08:10:36Z","updated_at":"2018-06-13T08:10:36Z","html_url":"https://github.com/thelounge/thelounge/pull/2552#discussion_r194990330","pull_request_url":"https://api.github.com/repos/thelounge/thelounge/pulls/2552","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/comments/194990330"},"html":{"href":"https://github.com/thelounge/thelounge/pull/2552#discussion_r194990330"},"pull_request":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2552"}}},"pull_request":{"url":"https://api.github.com/repos/thelounge/thelounge/pulls/2552","id":194366062,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0MzY2MDYy","html_url":"https://github.com/thelounge/thelounge/pull/2552","diff_url":"https://github.com/thelounge/thelounge/pull/2552.diff","patch_url":"https://github.com/thelounge/thelounge/pull/2552.patch","issue_url":"https://api.github.com/repos/thelounge/thelounge/issues/2552","number":2552,"state":"open","locked":false,"title":"Add file uploading support","user":{"login":"MaxLeiter","id":8675906,"node_id":"MDQ6VXNlcjg2NzU5MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/8675906?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxLeiter","html_url":"https://github.com/MaxLeiter","followers_url":"https://api.github.com/users/MaxLeiter/followers","following_url":"https://api.github.com/users/MaxLeiter/following{/other_user}","gists_url":"https://api.github.com/users/MaxLeiter/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxLeiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxLeiter/subscriptions","organizations_url":"https://api.github.com/users/MaxLeiter/orgs","repos_url":"https://api.github.com/users/MaxLeiter/repos","events_url":"https://api.github.com/users/MaxLeiter/events{/privacy}","received_events_url":"https://api.github.com/users/MaxLeiter/received_events","type":"User","site_admin":false},"body":"WIP\r\n\r\n- [ ] Drag-and-drop improved UI\r\n- [ ] Command to clear `uploads/`?\r\n  - [ ] Some other way to clear `uploads/`?\r\n- [ ] Hash URL like storage plugin?\r\n - [ ] tests?","created_at":"2018-06-12T18:18:24Z","updated_at":"2018-06-13T08:10:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"080ed3c71875cb95c4684f0fa4d133f2ab1feb15","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":323424562,"node_id":"MDU6TGFiZWwzMjM0MjQ1NjI=","url":"https://api.github.com/repos/thelounge/thelounge/labels/Type:%20Feature","name":"Type: Feature","color":"86c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/thelounge/thelounge/pulls/2552/commits","review_comments_url":"https://api.github.com/repos/thelounge/thelounge/pulls/2552/comments","review_comment_url":"https://api.github.com/repos/thelounge/thelounge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thelounge/thelounge/issues/2552/comments","statuses_url":"https://api.github.com/repos/thelounge/thelounge/statuses/98a5e18ae51b17ef79edce5a90bd4dc30d484cb1","head":{"label":"MaxLeiter:uploading","ref":"uploading","sha":"98a5e18ae51b17ef79edce5a90bd4dc30d484cb1","user":{"login":"MaxLeiter","id":8675906,"node_id":"MDQ6VXNlcjg2NzU5MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/8675906?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxLeiter","html_url":"https://github.com/MaxLeiter","followers_url":"https://api.github.com/users/MaxLeiter/followers","following_url":"https://api.github.com/users/MaxLeiter/following{/other_user}","gists_url":"https://api.github.com/users/MaxLeiter/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxLeiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxLeiter/subscriptions","organizations_url":"https://api.github.com/users/MaxLeiter/orgs","repos_url":"https://api.github.com/users/MaxLeiter/repos","events_url":"https://api.github.com/users/MaxLeiter/events{/privacy}","received_events_url":"https://api.github.com/users/MaxLeiter/received_events","type":"User","site_admin":false},"repo":{"id":51672528,"node_id":"MDEwOlJlcG9zaXRvcnk1MTY3MjUyOA==","name":"lounge","full_name":"MaxLeiter/lounge","owner":{"login":"MaxLeiter","id":8675906,"node_id":"MDQ6VXNlcjg2NzU5MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/8675906?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxLeiter","html_url":"https://github.com/MaxLeiter","followers_url":"https://api.github.com/users/MaxLeiter/followers","following_url":"https://api.github.com/users/MaxLeiter/following{/other_user}","gists_url":"https://api.github.com/users/MaxLeiter/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxLeiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxLeiter/subscriptions","organizations_url":"https://api.github.com/users/MaxLeiter/orgs","repos_url":"https://api.github.com/users/MaxLeiter/repos","events_url":"https://api.github.com/users/MaxLeiter/events{/privacy}","received_events_url":"https://api.github.com/users/MaxLeiter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaxLeiter/lounge","description":"The Lounge — Self-hosted web IRC client","fork":true,"url":"https://api.github.com/repos/MaxLeiter/lounge","forks_url":"https://api.github.com/repos/MaxLeiter/lounge/forks","keys_url":"https://api.github.com/repos/MaxLeiter/lounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaxLeiter/lounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaxLeiter/lounge/teams","hooks_url":"https://api.github.com/repos/MaxLeiter/lounge/hooks","issue_events_url":"https://api.github.com/repos/MaxLeiter/lounge/issues/events{/number}","events_url":"https://api.github.com/repos/MaxLeiter/lounge/events","assignees_url":"https://api.github.com/repos/MaxLeiter/lounge/assignees{/user}","branches_url":"https://api.github.com/repos/MaxLeiter/lounge/branches{/branch}","tags_url":"https://api.github.com/repos/MaxLeiter/lounge/tags","blobs_url":"https://api.github.com/repos/MaxLeiter/lounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaxLeiter/lounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaxLeiter/lounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaxLeiter/lounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaxLeiter/lounge/statuses/{sha}","languages_url":"https://api.github.com/repos/MaxLeiter/lounge/languages","stargazers_url":"https://api.github.com/repos/MaxLeiter/lounge/stargazers","contributors_url":"https://api.github.com/repos/MaxLeiter/lounge/contributors","subscribers_url":"https://api.github.com/repos/MaxLeiter/lounge/subscribers","subscription_url":"https://api.github.com/repos/MaxLeiter/lounge/subscription","commits_url":"https://api.github.com/repos/MaxLeiter/lounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaxLeiter/lounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaxLeiter/lounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaxLeiter/lounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaxLeiter/lounge/contents/{+path}","compare_url":"https://api.github.com/repos/MaxLeiter/lounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaxLeiter/lounge/merges","archive_url":"https://api.github.com/repos/MaxLeiter/lounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaxLeiter/lounge/downloads","issues_url":"https://api.github.com/repos/MaxLeiter/lounge/issues{/number}","pulls_url":"https://api.github.com/repos/MaxLeiter/lounge/pulls{/number}","milestones_url":"https://api.github.com/repos/MaxLeiter/lounge/milestones{/number}","notifications_url":"https://api.github.com/repos/MaxLeiter/lounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaxLeiter/lounge/labels{/name}","releases_url":"https://api.github.com/repos/MaxLeiter/lounge/releases{/id}","deployments_url":"https://api.github.com/repos/MaxLeiter/lounge/deployments","created_at":"2016-02-14T00:28:27Z","updated_at":"2018-06-11T23:34:49Z","pushed_at":"2018-06-12T21:49:17Z","git_url":"git://github.com/MaxLeiter/lounge.git","ssh_url":"git@github.com:MaxLeiter/lounge.git","clone_url":"https://github.com/MaxLeiter/lounge.git","svn_url":"https://github.com/MaxLeiter/lounge","homepage":"https://thelounge.github.io","size":13386,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thelounge:master","ref":"master","sha":"b54862022e1082d9420fe41fc7c0d7bcd243f8f9","user":{"login":"thelounge","id":14336958,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzM2OTU4","avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"repo":{"id":51344082,"node_id":"MDEwOlJlcG9zaXRvcnk1MTM0NDA4Mg==","name":"thelounge","full_name":"thelounge/thelounge","owner":{"login":"thelounge","id":14336958,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzM2OTU4","avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thelounge/thelounge","description":"💬 The Lounge — Modern self-hosted web IRC client","fork":false,"url":"https://api.github.com/repos/thelounge/thelounge","forks_url":"https://api.github.com/repos/thelounge/thelounge/forks","keys_url":"https://api.github.com/repos/thelounge/thelounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thelounge/thelounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thelounge/thelounge/teams","hooks_url":"https://api.github.com/repos/thelounge/thelounge/hooks","issue_events_url":"https://api.github.com/repos/thelounge/thelounge/issues/events{/number}","events_url":"https://api.github.com/repos/thelounge/thelounge/events","assignees_url":"https://api.github.com/repos/thelounge/thelounge/assignees{/user}","branches_url":"https://api.github.com/repos/thelounge/thelounge/branches{/branch}","tags_url":"https://api.github.com/repos/thelounge/thelounge/tags","blobs_url":"https://api.github.com/repos/thelounge/thelounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thelounge/thelounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thelounge/thelounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/thelounge/thelounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thelounge/thelounge/statuses/{sha}","languages_url":"https://api.github.com/repos/thelounge/thelounge/languages","stargazers_url":"https://api.github.com/repos/thelounge/thelounge/stargazers","contributors_url":"https://api.github.com/repos/thelounge/thelounge/contributors","subscribers_url":"https://api.github.com/repos/thelounge/thelounge/subscribers","subscription_url":"https://api.github.com/repos/thelounge/thelounge/subscription","commits_url":"https://api.github.com/repos/thelounge/thelounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/thelounge/thelounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/thelounge/thelounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/thelounge/thelounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/thelounge/thelounge/contents/{+path}","compare_url":"https://api.github.com/repos/thelounge/thelounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thelounge/thelounge/merges","archive_url":"https://api.github.com/repos/thelounge/thelounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thelounge/thelounge/downloads","issues_url":"https://api.github.com/repos/thelounge/thelounge/issues{/number}","pulls_url":"https://api.github.com/repos/thelounge/thelounge/pulls{/number}","milestones_url":"https://api.github.com/repos/thelounge/thelounge/milestones{/number}","notifications_url":"https://api.github.com/repos/thelounge/thelounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thelounge/thelounge/labels{/name}","releases_url":"https://api.github.com/repos/thelounge/thelounge/releases{/id}","deployments_url":"https://api.github.com/repos/thelounge/thelounge/deployments","created_at":"2016-02-09T03:16:03Z","updated_at":"2018-06-12T23:19:26Z","pushed_at":"2018-06-12T23:35:57Z","git_url":"git://github.com/thelounge/thelounge.git","ssh_url":"git@github.com:thelounge/thelounge.git","clone_url":"https://github.com/thelounge/thelounge.git","svn_url":"https://github.com/thelounge/thelounge","homepage":"https://thelounge.chat","size":9669,"stargazers_count":1945,"watchers_count":1945,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":298,"mirror_url":null,"archived":false,"open_issues_count":192,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":298,"open_issues":192,"watchers":1945,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2552"},"html":{"href":"https://github.com/thelounge/thelounge/pull/2552"},"issue":{"href":"https://api.github.com/repos/thelounge/thelounge/issues/2552"},"comments":{"href":"https://api.github.com/repos/thelounge/thelounge/issues/2552/comments"},"review_comments":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2552/comments"},"review_comment":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2552/commits"},"statuses":{"href":"https://api.github.com/repos/thelounge/thelounge/statuses/98a5e18ae51b17ef79edce5a90bd4dc30d484cb1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"xPaw"}}