{"action":"created","comment":{"url":"https://api.github.com/repos/amberframework/amber/pulls/comments/167347139","pull_request_review_id":95560493,"id":167347139,"diff_hunk":"@@ -0,0 +1,26 @@\n+require \"tempfile\"\n+\n+module Amber::Router\n+  struct File\n+    getter file : Tempfile\n+    getter filename : String?\n+    getter headers : HTTP::Headers\n+    getter creation_time : Time?\n+    getter modification_time : Time?\n+    getter read_time : Time?\n+    getter size : UInt64?\n+\n+    def initialize(upload)\n+      @filename = upload.filename","path":"src/amber/router/file.cr","position":14,"original_position":14,"commit_id":"8cbc21a96fcdd7cf059173909f847ba8824adafa","original_commit_id":"8cbc21a96fcdd7cf059173909f847ba8824adafa","user":{"login":"robacarp","id":208647,"avatar_url":"https://avatars3.githubusercontent.com/u/208647?v=4","gravatar_id":"","url":"https://api.github.com/users/robacarp","html_url":"https://github.com/robacarp","followers_url":"https://api.github.com/users/robacarp/followers","following_url":"https://api.github.com/users/robacarp/following{/other_user}","gists_url":"https://api.github.com/users/robacarp/gists{/gist_id}","starred_url":"https://api.github.com/users/robacarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robacarp/subscriptions","organizations_url":"https://api.github.com/users/robacarp/orgs","repos_url":"https://api.github.com/users/robacarp/repos","events_url":"https://api.github.com/users/robacarp/events{/privacy}","received_events_url":"https://api.github.com/users/robacarp/received_events","type":"User","site_admin":false},"body":"Is `upload.filename` direct from end user form submission? Is naming a file on the disk by a string provided from some unknown source a dangerous idea? Could this be changed so that the tempfile has a uuid name, but the `Router::File#filename` method still returns the name that was sent in the request?","created_at":"2018-02-09T21:12:48Z","updated_at":"2018-02-09T21:26:51Z","html_url":"https://github.com/amberframework/amber/pull/637#discussion_r167347139","pull_request_url":"https://api.github.com/repos/amberframework/amber/pulls/637","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/amberframework/amber/pulls/comments/167347139"},"html":{"href":"https://github.com/amberframework/amber/pull/637#discussion_r167347139"},"pull_request":{"href":"https://api.github.com/repos/amberframework/amber/pulls/637"}}},"pull_request":{"url":"https://api.github.com/repos/amberframework/amber/pulls/637","id":167836669,"html_url":"https://github.com/amberframework/amber/pull/637","diff_url":"https://github.com/amberframework/amber/pull/637.diff","patch_url":"https://github.com/amberframework/amber/pull/637.patch","issue_url":"https://api.github.com/repos/amberframework/amber/issues/637","number":637,"state":"open","locked":false,"title":"Refactors Params into Module, Addresses Issue  #592","user":{"login":"eliasjpr","id":1685772,"avatar_url":"https://avatars2.githubusercontent.com/u/1685772?v=4","gravatar_id":"","url":"https://api.github.com/users/eliasjpr","html_url":"https://github.com/eliasjpr","followers_url":"https://api.github.com/users/eliasjpr/followers","following_url":"https://api.github.com/users/eliasjpr/following{/other_user}","gists_url":"https://api.github.com/users/eliasjpr/gists{/gist_id}","starred_url":"https://api.github.com/users/eliasjpr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliasjpr/subscriptions","organizations_url":"https://api.github.com/users/eliasjpr/orgs","repos_url":"https://api.github.com/users/eliasjpr/repos","events_url":"https://api.github.com/users/eliasjpr/events{/privacy}","received_events_url":"https://api.github.com/users/eliasjpr/received_events","type":"User","site_admin":false},"body":"Refactors Params into Modules\r\n\r\nIssue  #592\r\n\r\n> As a developer I want to parse params and return an array of values\r\nfor a given param key.\r\n\r\nThe changes here introduces a Parser module that handles parsing query\r\nparams. It organizes each parser into its own class.\r\n\r\nList of changes:\r\n- Adds Params Specs\r\n- Adss params class\r\n- Moves Amber::Router::Files::File to Amber::Router::File\r\n- Allows to parse form data from request body\r\n- Allows for parsing form Multipart form data\r\n- Allows for JSON request body parsing\r\n- Adds a Request.cr file \r\n- Removes the original ParamsParser in favor of the new Parser\r\n- Cleans context spec \r\n- Params are parsed only once per request (Adds parse state to memoize)\r\n- Removes redundant Request Handler Method now is request.route\r\n- Repurpose invalid_route? to valid_route? (the logic in the method is easier to read and understand)\r\n- [Controller] Error fixes error controller (This was also addressed by @marksiemers in another PR) I made the change here because it was hindering development.\r\n\r\nThese changes allows for lazy loading params in instances where  there is no need to override method, and matching Radix route, with this change we can work on allowing Pipelines to run before  matching a route.\r\n\r\nThanks @elorest for the pairing session for shedding some light on the module and Params struct","created_at":"2018-02-07T23:18:09Z","updated_at":"2018-02-09T21:26:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31fc5ece454af2ad539a063c2453d93c261a9e25","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/amberframework/amber/pulls/637/commits","review_comments_url":"https://api.github.com/repos/amberframework/amber/pulls/637/comments","review_comment_url":"https://api.github.com/repos/amberframework/amber/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amberframework/amber/issues/637/comments","statuses_url":"https://api.github.com/repos/amberframework/amber/statuses/8cbc21a96fcdd7cf059173909f847ba8824adafa","head":{"label":"amberframework:ep/params-refactor","ref":"ep/params-refactor","sha":"8cbc21a96fcdd7cf059173909f847ba8824adafa","user":{"login":"amberframework","id":27691024,"avatar_url":"https://avatars1.githubusercontent.com/u/27691024?v=4","gravatar_id":"","url":"https://api.github.com/users/amberframework","html_url":"https://github.com/amberframework","followers_url":"https://api.github.com/users/amberframework/followers","following_url":"https://api.github.com/users/amberframework/following{/other_user}","gists_url":"https://api.github.com/users/amberframework/gists{/gist_id}","starred_url":"https://api.github.com/users/amberframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amberframework/subscriptions","organizations_url":"https://api.github.com/users/amberframework/orgs","repos_url":"https://api.github.com/users/amberframework/repos","events_url":"https://api.github.com/users/amberframework/events{/privacy}","received_events_url":"https://api.github.com/users/amberframework/received_events","type":"Organization","site_admin":false},"repo":{"id":88535378,"name":"amber","full_name":"amberframework/amber","owner":{"login":"amberframework","id":27691024,"avatar_url":"https://avatars1.githubusercontent.com/u/27691024?v=4","gravatar_id":"","url":"https://api.github.com/users/amberframework","html_url":"https://github.com/amberframework","followers_url":"https://api.github.com/users/amberframework/followers","following_url":"https://api.github.com/users/amberframework/following{/other_user}","gists_url":"https://api.github.com/users/amberframework/gists{/gist_id}","starred_url":"https://api.github.com/users/amberframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amberframework/subscriptions","organizations_url":"https://api.github.com/users/amberframework/orgs","repos_url":"https://api.github.com/users/amberframework/repos","events_url":"https://api.github.com/users/amberframework/events{/privacy}","received_events_url":"https://api.github.com/users/amberframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amberframework/amber","description":"Amber makes building web applications fast, simple, and enjoyable. Get started with blazing fast performance. ","fork":false,"url":"https://api.github.com/repos/amberframework/amber","forks_url":"https://api.github.com/repos/amberframework/amber/forks","keys_url":"https://api.github.com/repos/amberframework/amber/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amberframework/amber/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amberframework/amber/teams","hooks_url":"https://api.github.com/repos/amberframework/amber/hooks","issue_events_url":"https://api.github.com/repos/amberframework/amber/issues/events{/number}","events_url":"https://api.github.com/repos/amberframework/amber/events","assignees_url":"https://api.github.com/repos/amberframework/amber/assignees{/user}","branches_url":"https://api.github.com/repos/amberframework/amber/branches{/branch}","tags_url":"https://api.github.com/repos/amberframework/amber/tags","blobs_url":"https://api.github.com/repos/amberframework/amber/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amberframework/amber/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amberframework/amber/git/refs{/sha}","trees_url":"https://api.github.com/repos/amberframework/amber/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amberframework/amber/statuses/{sha}","languages_url":"https://api.github.com/repos/amberframework/amber/languages","stargazers_url":"https://api.github.com/repos/amberframework/amber/stargazers","contributors_url":"https://api.github.com/repos/amberframework/amber/contributors","subscribers_url":"https://api.github.com/repos/amberframework/amber/subscribers","subscription_url":"https://api.github.com/repos/amberframework/amber/subscription","commits_url":"https://api.github.com/repos/amberframework/amber/commits{/sha}","git_commits_url":"https://api.github.com/repos/amberframework/amber/git/commits{/sha}","comments_url":"https://api.github.com/repos/amberframework/amber/comments{/number}","issue_comment_url":"https://api.github.com/repos/amberframework/amber/issues/comments{/number}","contents_url":"https://api.github.com/repos/amberframework/amber/contents/{+path}","compare_url":"https://api.github.com/repos/amberframework/amber/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amberframework/amber/merges","archive_url":"https://api.github.com/repos/amberframework/amber/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amberframework/amber/downloads","issues_url":"https://api.github.com/repos/amberframework/amber/issues{/number}","pulls_url":"https://api.github.com/repos/amberframework/amber/pulls{/number}","milestones_url":"https://api.github.com/repos/amberframework/amber/milestones{/number}","notifications_url":"https://api.github.com/repos/amberframework/amber/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amberframework/amber/labels{/name}","releases_url":"https://api.github.com/repos/amberframework/amber/releases{/id}","deployments_url":"https://api.github.com/repos/amberframework/amber/deployments","created_at":"2017-04-17T18:02:35Z","updated_at":"2018-02-09T20:07:33Z","pushed_at":"2018-02-09T20:40:47Z","git_url":"git://github.com/amberframework/amber.git","ssh_url":"git@github.com:amberframework/amber.git","clone_url":"https://github.com/amberframework/amber.git","svn_url":"https://github.com/amberframework/amber","homepage":"https://amberframework.org","size":1305,"stargazers_count":811,"watchers_count":811,"language":"Crystal","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":39,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":62,"open_issues":39,"watchers":811,"default_branch":"master"}},"base":{"label":"amberframework:master","ref":"master","sha":"5be1f97c4bcdef50e1f51246e5046811e831db91","user":{"login":"amberframework","id":27691024,"avatar_url":"https://avatars1.githubusercontent.com/u/27691024?v=4","gravatar_id":"","url":"https://api.github.com/users/amberframework","html_url":"https://github.com/amberframework","followers_url":"https://api.github.com/users/amberframework/followers","following_url":"https://api.github.com/users/amberframework/following{/other_user}","gists_url":"https://api.github.com/users/amberframework/gists{/gist_id}","starred_url":"https://api.github.com/users/amberframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amberframework/subscriptions","organizations_url":"https://api.github.com/users/amberframework/orgs","repos_url":"https://api.github.com/users/amberframework/repos","events_url":"https://api.github.com/users/amberframework/events{/privacy}","received_events_url":"https://api.github.com/users/amberframework/received_events","type":"Organization","site_admin":false},"repo":{"id":88535378,"name":"amber","full_name":"amberframework/amber","owner":{"login":"amberframework","id":27691024,"avatar_url":"https://avatars1.githubusercontent.com/u/27691024?v=4","gravatar_id":"","url":"https://api.github.com/users/amberframework","html_url":"https://github.com/amberframework","followers_url":"https://api.github.com/users/amberframework/followers","following_url":"https://api.github.com/users/amberframework/following{/other_user}","gists_url":"https://api.github.com/users/amberframework/gists{/gist_id}","starred_url":"https://api.github.com/users/amberframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amberframework/subscriptions","organizations_url":"https://api.github.com/users/amberframework/orgs","repos_url":"https://api.github.com/users/amberframework/repos","events_url":"https://api.github.com/users/amberframework/events{/privacy}","received_events_url":"https://api.github.com/users/amberframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amberframework/amber","description":"Amber makes building web applications fast, simple, and enjoyable. Get started with blazing fast performance. ","fork":false,"url":"https://api.github.com/repos/amberframework/amber","forks_url":"https://api.github.com/repos/amberframework/amber/forks","keys_url":"https://api.github.com/repos/amberframework/amber/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amberframework/amber/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amberframework/amber/teams","hooks_url":"https://api.github.com/repos/amberframework/amber/hooks","issue_events_url":"https://api.github.com/repos/amberframework/amber/issues/events{/number}","events_url":"https://api.github.com/repos/amberframework/amber/events","assignees_url":"https://api.github.com/repos/amberframework/amber/assignees{/user}","branches_url":"https://api.github.com/repos/amberframework/amber/branches{/branch}","tags_url":"https://api.github.com/repos/amberframework/amber/tags","blobs_url":"https://api.github.com/repos/amberframework/amber/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amberframework/amber/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amberframework/amber/git/refs{/sha}","trees_url":"https://api.github.com/repos/amberframework/amber/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amberframework/amber/statuses/{sha}","languages_url":"https://api.github.com/repos/amberframework/amber/languages","stargazers_url":"https://api.github.com/repos/amberframework/amber/stargazers","contributors_url":"https://api.github.com/repos/amberframework/amber/contributors","subscribers_url":"https://api.github.com/repos/amberframework/amber/subscribers","subscription_url":"https://api.github.com/repos/amberframework/amber/subscription","commits_url":"https://api.github.com/repos/amberframework/amber/commits{/sha}","git_commits_url":"https://api.github.com/repos/amberframework/amber/git/commits{/sha}","comments_url":"https://api.github.com/repos/amberframework/amber/comments{/number}","issue_comment_url":"https://api.github.com/repos/amberframework/amber/issues/comments{/number}","contents_url":"https://api.github.com/repos/amberframework/amber/contents/{+path}","compare_url":"https://api.github.com/repos/amberframework/amber/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amberframework/amber/merges","archive_url":"https://api.github.com/repos/amberframework/amber/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amberframework/amber/downloads","issues_url":"https://api.github.com/repos/amberframework/amber/issues{/number}","pulls_url":"https://api.github.com/repos/amberframework/amber/pulls{/number}","milestones_url":"https://api.github.com/repos/amberframework/amber/milestones{/number}","notifications_url":"https://api.github.com/repos/amberframework/amber/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amberframework/amber/labels{/name}","releases_url":"https://api.github.com/repos/amberframework/amber/releases{/id}","deployments_url":"https://api.github.com/repos/amberframework/amber/deployments","created_at":"2017-04-17T18:02:35Z","updated_at":"2018-02-09T20:07:33Z","pushed_at":"2018-02-09T20:40:47Z","git_url":"git://github.com/amberframework/amber.git","ssh_url":"git@github.com:amberframework/amber.git","clone_url":"https://github.com/amberframework/amber.git","svn_url":"https://github.com/amberframework/amber","homepage":"https://amberframework.org","size":1305,"stargazers_count":811,"watchers_count":811,"language":"Crystal","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":39,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":62,"open_issues":39,"watchers":811,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amberframework/amber/pulls/637"},"html":{"href":"https://github.com/amberframework/amber/pull/637"},"issue":{"href":"https://api.github.com/repos/amberframework/amber/issues/637"},"comments":{"href":"https://api.github.com/repos/amberframework/amber/issues/637/comments"},"review_comments":{"href":"https://api.github.com/repos/amberframework/amber/pulls/637/comments"},"review_comment":{"href":"https://api.github.com/repos/amberframework/amber/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amberframework/amber/pulls/637/commits"},"statuses":{"href":"https://api.github.com/repos/amberframework/amber/statuses/8cbc21a96fcdd7cf059173909f847ba8824adafa"}},"author_association":"OWNER"}}
{"actor":{"display_login":"robacarp"}}