{"action":"created","comment":{"url":"https://api.github.com/repos/sdogruyol/kemal/pulls/comments/79292473","id":79292473,"diff_hunk":"@@ -1,13 +1,94 @@\n+require \"zlib\" ifdef !without_zlib\n+\n module Kemal\n-  # Kemal::StaticFileHandler is used to serve static files(.js/.css/.png e.g).\n-  # This handler is on by default and you can disable it like.\n-  #\n-  #   serve_static false\n-  #\n+\n   class StaticFileHandler < HTTP::StaticFileHandler\n+    \n     def call(context)\n       return call_next(context) if context.request.path.not_nil! == \"/\"\n-      super\n+\n+      unless context.request.method == \"GET\" || context.request.method == \"HEAD\"","path":"src/kemal/static_file_handler.cr","position":16,"original_position":16,"commit_id":"e3c0ae148674b7eb3965fc4d73fa13e33aaddd1c","original_commit_id":"e3c0ae148674b7eb3965fc4d73fa13e33aaddd1c","user":{"login":"f","id":196477,"avatar_url":"https://avatars.githubusercontent.com/u/196477?v=3","gravatar_id":"","url":"https://api.github.com/users/f","html_url":"https://github.com/f","followers_url":"https://api.github.com/users/f/followers","following_url":"https://api.github.com/users/f/following{/other_user}","gists_url":"https://api.github.com/users/f/gists{/gist_id}","starred_url":"https://api.github.com/users/f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f/subscriptions","organizations_url":"https://api.github.com/users/f/orgs","repos_url":"https://api.github.com/users/f/repos","events_url":"https://api.github.com/users/f/events{/privacy}","received_events_url":"https://api.github.com/users/f/received_events","type":"User","site_admin":false},"body":"Ok no problem to me. I just wanted to make the code more readable. But doesn't matter :)","created_at":"2016-09-17T21:33:01Z","updated_at":"2016-09-17T21:33:01Z","html_url":"https://github.com/sdogruyol/kemal/pull/204#discussion_r79292473","pull_request_url":"https://api.github.com/repos/sdogruyol/kemal/pulls/204","_links":{"self":{"href":"https://api.github.com/repos/sdogruyol/kemal/pulls/comments/79292473"},"html":{"href":"https://github.com/sdogruyol/kemal/pull/204#discussion_r79292473"},"pull_request":{"href":"https://api.github.com/repos/sdogruyol/kemal/pulls/204"}}},"pull_request":{"url":"https://api.github.com/repos/sdogruyol/kemal/pulls/204","id":85478783,"html_url":"https://github.com/sdogruyol/kemal/pull/204","diff_url":"https://github.com/sdogruyol/kemal/pull/204.diff","patch_url":"https://github.com/sdogruyol/kemal/pull/204.patch","issue_url":"https://api.github.com/repos/sdogruyol/kemal/issues/204","number":204,"state":"open","locked":false,"title":"gzip for static files","user":{"login":"crisward","id":3109157,"avatar_url":"https://avatars.githubusercontent.com/u/3109157?v=3","gravatar_id":"","url":"https://api.github.com/users/crisward","html_url":"https://github.com/crisward","followers_url":"https://api.github.com/users/crisward/followers","following_url":"https://api.github.com/users/crisward/following{/other_user}","gists_url":"https://api.github.com/users/crisward/gists{/gist_id}","starred_url":"https://api.github.com/users/crisward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisward/subscriptions","organizations_url":"https://api.github.com/users/crisward/orgs","repos_url":"https://api.github.com/users/crisward/repos","events_url":"https://api.github.com/users/crisward/events{/privacy}","received_events_url":"https://api.github.com/users/crisward/received_events","type":"User","site_admin":false},"body":"I can see you've started adding a helper for gzip, so this may not be exactly correct.\r\nBut take a look and I'll be happy to modify / add tests.\r\n\r\nThe code is taken in part from HTTP::StaticFileHandler mixed with HTTP::DeflateHandler\r\n\r\nI've also added a min size, and list of file types to gzip.","created_at":"2016-09-15T20:56:28Z","updated_at":"2016-09-17T21:33:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33437fba46301b3c91bb34abb7406b22f4b25b9d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sdogruyol/kemal/pulls/204/commits","review_comments_url":"https://api.github.com/repos/sdogruyol/kemal/pulls/204/comments","review_comment_url":"https://api.github.com/repos/sdogruyol/kemal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sdogruyol/kemal/issues/204/comments","statuses_url":"https://api.github.com/repos/sdogruyol/kemal/statuses/e3c0ae148674b7eb3965fc4d73fa13e33aaddd1c","head":{"label":"crisward:master","ref":"master","sha":"e3c0ae148674b7eb3965fc4d73fa13e33aaddd1c","user":{"login":"crisward","id":3109157,"avatar_url":"https://avatars.githubusercontent.com/u/3109157?v=3","gravatar_id":"","url":"https://api.github.com/users/crisward","html_url":"https://github.com/crisward","followers_url":"https://api.github.com/users/crisward/followers","following_url":"https://api.github.com/users/crisward/following{/other_user}","gists_url":"https://api.github.com/users/crisward/gists{/gist_id}","starred_url":"https://api.github.com/users/crisward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisward/subscriptions","organizations_url":"https://api.github.com/users/crisward/orgs","repos_url":"https://api.github.com/users/crisward/repos","events_url":"https://api.github.com/users/crisward/events{/privacy}","received_events_url":"https://api.github.com/users/crisward/received_events","type":"User","site_admin":false},"repo":{"id":68329866,"name":"kemal","full_name":"crisward/kemal","owner":{"login":"crisward","id":3109157,"avatar_url":"https://avatars.githubusercontent.com/u/3109157?v=3","gravatar_id":"","url":"https://api.github.com/users/crisward","html_url":"https://github.com/crisward","followers_url":"https://api.github.com/users/crisward/followers","following_url":"https://api.github.com/users/crisward/following{/other_user}","gists_url":"https://api.github.com/users/crisward/gists{/gist_id}","starred_url":"https://api.github.com/users/crisward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisward/subscriptions","organizations_url":"https://api.github.com/users/crisward/orgs","repos_url":"https://api.github.com/users/crisward/repos","events_url":"https://api.github.com/users/crisward/events{/privacy}","received_events_url":"https://api.github.com/users/crisward/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crisward/kemal","description":"Lightning Fast, Super Simple web framework for Crystal","fork":true,"url":"https://api.github.com/repos/crisward/kemal","forks_url":"https://api.github.com/repos/crisward/kemal/forks","keys_url":"https://api.github.com/repos/crisward/kemal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crisward/kemal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crisward/kemal/teams","hooks_url":"https://api.github.com/repos/crisward/kemal/hooks","issue_events_url":"https://api.github.com/repos/crisward/kemal/issues/events{/number}","events_url":"https://api.github.com/repos/crisward/kemal/events","assignees_url":"https://api.github.com/repos/crisward/kemal/assignees{/user}","branches_url":"https://api.github.com/repos/crisward/kemal/branches{/branch}","tags_url":"https://api.github.com/repos/crisward/kemal/tags","blobs_url":"https://api.github.com/repos/crisward/kemal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crisward/kemal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crisward/kemal/git/refs{/sha}","trees_url":"https://api.github.com/repos/crisward/kemal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crisward/kemal/statuses/{sha}","languages_url":"https://api.github.com/repos/crisward/kemal/languages","stargazers_url":"https://api.github.com/repos/crisward/kemal/stargazers","contributors_url":"https://api.github.com/repos/crisward/kemal/contributors","subscribers_url":"https://api.github.com/repos/crisward/kemal/subscribers","subscription_url":"https://api.github.com/repos/crisward/kemal/subscription","commits_url":"https://api.github.com/repos/crisward/kemal/commits{/sha}","git_commits_url":"https://api.github.com/repos/crisward/kemal/git/commits{/sha}","comments_url":"https://api.github.com/repos/crisward/kemal/comments{/number}","issue_comment_url":"https://api.github.com/repos/crisward/kemal/issues/comments{/number}","contents_url":"https://api.github.com/repos/crisward/kemal/contents/{+path}","compare_url":"https://api.github.com/repos/crisward/kemal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crisward/kemal/merges","archive_url":"https://api.github.com/repos/crisward/kemal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crisward/kemal/downloads","issues_url":"https://api.github.com/repos/crisward/kemal/issues{/number}","pulls_url":"https://api.github.com/repos/crisward/kemal/pulls{/number}","milestones_url":"https://api.github.com/repos/crisward/kemal/milestones{/number}","notifications_url":"https://api.github.com/repos/crisward/kemal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crisward/kemal/labels{/name}","releases_url":"https://api.github.com/repos/crisward/kemal/releases{/id}","deployments_url":"https://api.github.com/repos/crisward/kemal/deployments","created_at":"2016-09-15T20:43:36Z","updated_at":"2016-09-15T20:43:37Z","pushed_at":"2016-09-16T06:03:16Z","git_url":"git://github.com/crisward/kemal.git","ssh_url":"git@github.com:crisward/kemal.git","clone_url":"https://github.com/crisward/kemal.git","svn_url":"https://github.com/crisward/kemal","homepage":"http://kemalcr.com","size":397,"stargazers_count":0,"watchers_count":0,"language":"Crystal","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sdogruyol:master","ref":"master","sha":"2ff5991c92156093ecdca27f5e75b7956dbb8987","user":{"login":"sdogruyol","id":990485,"avatar_url":"https://avatars.githubusercontent.com/u/990485?v=3","gravatar_id":"","url":"https://api.github.com/users/sdogruyol","html_url":"https://github.com/sdogruyol","followers_url":"https://api.github.com/users/sdogruyol/followers","following_url":"https://api.github.com/users/sdogruyol/following{/other_user}","gists_url":"https://api.github.com/users/sdogruyol/gists{/gist_id}","starred_url":"https://api.github.com/users/sdogruyol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdogruyol/subscriptions","organizations_url":"https://api.github.com/users/sdogruyol/orgs","repos_url":"https://api.github.com/users/sdogruyol/repos","events_url":"https://api.github.com/users/sdogruyol/events{/privacy}","received_events_url":"https://api.github.com/users/sdogruyol/received_events","type":"User","site_admin":false},"repo":{"id":44826364,"name":"kemal","full_name":"sdogruyol/kemal","owner":{"login":"sdogruyol","id":990485,"avatar_url":"https://avatars.githubusercontent.com/u/990485?v=3","gravatar_id":"","url":"https://api.github.com/users/sdogruyol","html_url":"https://github.com/sdogruyol","followers_url":"https://api.github.com/users/sdogruyol/followers","following_url":"https://api.github.com/users/sdogruyol/following{/other_user}","gists_url":"https://api.github.com/users/sdogruyol/gists{/gist_id}","starred_url":"https://api.github.com/users/sdogruyol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdogruyol/subscriptions","organizations_url":"https://api.github.com/users/sdogruyol/orgs","repos_url":"https://api.github.com/users/sdogruyol/repos","events_url":"https://api.github.com/users/sdogruyol/events{/privacy}","received_events_url":"https://api.github.com/users/sdogruyol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdogruyol/kemal","description":"Lightning Fast, Super Simple web framework for Crystal","fork":false,"url":"https://api.github.com/repos/sdogruyol/kemal","forks_url":"https://api.github.com/repos/sdogruyol/kemal/forks","keys_url":"https://api.github.com/repos/sdogruyol/kemal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdogruyol/kemal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdogruyol/kemal/teams","hooks_url":"https://api.github.com/repos/sdogruyol/kemal/hooks","issue_events_url":"https://api.github.com/repos/sdogruyol/kemal/issues/events{/number}","events_url":"https://api.github.com/repos/sdogruyol/kemal/events","assignees_url":"https://api.github.com/repos/sdogruyol/kemal/assignees{/user}","branches_url":"https://api.github.com/repos/sdogruyol/kemal/branches{/branch}","tags_url":"https://api.github.com/repos/sdogruyol/kemal/tags","blobs_url":"https://api.github.com/repos/sdogruyol/kemal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdogruyol/kemal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdogruyol/kemal/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdogruyol/kemal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdogruyol/kemal/statuses/{sha}","languages_url":"https://api.github.com/repos/sdogruyol/kemal/languages","stargazers_url":"https://api.github.com/repos/sdogruyol/kemal/stargazers","contributors_url":"https://api.github.com/repos/sdogruyol/kemal/contributors","subscribers_url":"https://api.github.com/repos/sdogruyol/kemal/subscribers","subscription_url":"https://api.github.com/repos/sdogruyol/kemal/subscription","commits_url":"https://api.github.com/repos/sdogruyol/kemal/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdogruyol/kemal/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdogruyol/kemal/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdogruyol/kemal/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdogruyol/kemal/contents/{+path}","compare_url":"https://api.github.com/repos/sdogruyol/kemal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdogruyol/kemal/merges","archive_url":"https://api.github.com/repos/sdogruyol/kemal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdogruyol/kemal/downloads","issues_url":"https://api.github.com/repos/sdogruyol/kemal/issues{/number}","pulls_url":"https://api.github.com/repos/sdogruyol/kemal/pulls{/number}","milestones_url":"https://api.github.com/repos/sdogruyol/kemal/milestones{/number}","notifications_url":"https://api.github.com/repos/sdogruyol/kemal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdogruyol/kemal/labels{/name}","releases_url":"https://api.github.com/repos/sdogruyol/kemal/releases{/id}","deployments_url":"https://api.github.com/repos/sdogruyol/kemal/deployments","created_at":"2015-10-23T16:56:29Z","updated_at":"2016-09-17T13:42:33Z","pushed_at":"2016-09-16T19:35:38Z","git_url":"git://github.com/sdogruyol/kemal.git","ssh_url":"git@github.com:sdogruyol/kemal.git","clone_url":"https://github.com/sdogruyol/kemal.git","svn_url":"https://github.com/sdogruyol/kemal","homepage":"http://kemalcr.com","size":452,"stargazers_count":1038,"watchers_count":1038,"language":"Crystal","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":62,"mirror_url":null,"open_issues_count":5,"forks":62,"open_issues":5,"watchers":1038,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sdogruyol/kemal/pulls/204"},"html":{"href":"https://github.com/sdogruyol/kemal/pull/204"},"issue":{"href":"https://api.github.com/repos/sdogruyol/kemal/issues/204"},"comments":{"href":"https://api.github.com/repos/sdogruyol/kemal/issues/204/comments"},"review_comments":{"href":"https://api.github.com/repos/sdogruyol/kemal/pulls/204/comments"},"review_comment":{"href":"https://api.github.com/repos/sdogruyol/kemal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sdogruyol/kemal/pulls/204/commits"},"statuses":{"href":"https://api.github.com/repos/sdogruyol/kemal/statuses/e3c0ae148674b7eb3965fc4d73fa13e33aaddd1c"}}}}
{"actor":{"display_login":"f"}}