{"action":"created","comment":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/comments/32309349","id":32309349,"diff_hunk":"@@ -435,8 +445,12 @@ def enable_chunked_encoding(self, chunk_size=None):\n         self._chunked = True\n         self._chunk_size = chunk_size\n \n-    def enable_compression(self, force=False):\n-        \"\"\"Enables response compression with `deflate` encoding.\"\"\"\n+    def enable_compression(self, force=None):\n+        \"\"\"Enables response compression encoding.\"\"\"\n+        # Backwards compatibility for when force was a bool <0.17.\n+        if type(force) == bool:\n+            force = ContentCoding.deflate if force else None","path":"aiohttp/web_reqrep.py","position":40,"original_position":40,"commit_id":"275dbac47b55a853e8b61557ef5190739b173931","original_commit_id":"275dbac47b55a853e8b61557ef5190739b173931","user":{"login":"asvetlov","id":356399,"avatar_url":"https://avatars.githubusercontent.com/u/356399?v=3","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"body":"`force = ContentCoding.deflate if force else ContentCoding.identity`","created_at":"2015-06-12T11:52:45Z","updated_at":"2015-06-12T11:52:45Z","html_url":"https://github.com/KeepSafe/aiohttp/pull/403#discussion_r32309349","pull_request_url":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403","_links":{"self":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/comments/32309349"},"html":{"href":"https://github.com/KeepSafe/aiohttp/pull/403#discussion_r32309349"},"pull_request":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403"}}},"pull_request":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403","id":37187713,"html_url":"https://github.com/KeepSafe/aiohttp/pull/403","diff_url":"https://github.com/KeepSafe/aiohttp/pull/403.diff","patch_url":"https://github.com/KeepSafe/aiohttp/pull/403.patch","issue_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/403","number":403,"state":"open","locked":false,"title":"Allow gzip compression in high-level server response interface","user":{"login":"danielnelson","id":1048079,"avatar_url":"https://avatars.githubusercontent.com/u/1048079?v=3","gravatar_id":"","url":"https://api.github.com/users/danielnelson","html_url":"https://github.com/danielnelson","followers_url":"https://api.github.com/users/danielnelson/followers","following_url":"https://api.github.com/users/danielnelson/following{/other_user}","gists_url":"https://api.github.com/users/danielnelson/gists{/gist_id}","starred_url":"https://api.github.com/users/danielnelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielnelson/subscriptions","organizations_url":"https://api.github.com/users/danielnelson/orgs","repos_url":"https://api.github.com/users/danielnelson/repos","events_url":"https://api.github.com/users/danielnelson/events{/privacy}","received_events_url":"https://api.github.com/users/danielnelson/received_events","type":"User","site_admin":false},"body":"Add encoding kwarg to enable_compression to select gzip or deflate and\r\nset Content-Encoding header.\r\n\r\nThis is for issue #396.\r\n\r\nI have a few concerns about this code:\r\n\r\nI think that when using a high level interface one would generally want to simply enable all types of compression that are supported by the library, with selection automatically made based on the Accept-Encoding header.  Potentially one may want to optionally specify a subset of the available encoding types, such as if we had compress support, maybe one would want to allow *gzip* and *compress* but not *deflate*.\r\n\r\nI considered changing the signature to accept a sequence of encodings, however if we do this it is no longer intuitive to me how the `force` argument behaves.\r\n\r\nLet me know how you think it would best to proceed.\r\n","created_at":"2015-06-08T19:35:12Z","updated_at":"2015-06-12T11:52:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64865e94cfd333aa0737e8cf43067939f61db18f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403/commits","review_comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403/comments","review_comment_url":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/403/comments","statuses_url":"https://api.github.com/repos/KeepSafe/aiohttp/statuses/275dbac47b55a853e8b61557ef5190739b173931","head":{"label":"danielnelson:add-encoding-to-enable-compression","ref":"add-encoding-to-enable-compression","sha":"275dbac47b55a853e8b61557ef5190739b173931","user":{"login":"danielnelson","id":1048079,"avatar_url":"https://avatars.githubusercontent.com/u/1048079?v=3","gravatar_id":"","url":"https://api.github.com/users/danielnelson","html_url":"https://github.com/danielnelson","followers_url":"https://api.github.com/users/danielnelson/followers","following_url":"https://api.github.com/users/danielnelson/following{/other_user}","gists_url":"https://api.github.com/users/danielnelson/gists{/gist_id}","starred_url":"https://api.github.com/users/danielnelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielnelson/subscriptions","organizations_url":"https://api.github.com/users/danielnelson/orgs","repos_url":"https://api.github.com/users/danielnelson/repos","events_url":"https://api.github.com/users/danielnelson/events{/privacy}","received_events_url":"https://api.github.com/users/danielnelson/received_events","type":"User","site_admin":false},"repo":{"id":35907956,"name":"aiohttp","full_name":"danielnelson/aiohttp","owner":{"login":"danielnelson","id":1048079,"avatar_url":"https://avatars.githubusercontent.com/u/1048079?v=3","gravatar_id":"","url":"https://api.github.com/users/danielnelson","html_url":"https://github.com/danielnelson","followers_url":"https://api.github.com/users/danielnelson/followers","following_url":"https://api.github.com/users/danielnelson/following{/other_user}","gists_url":"https://api.github.com/users/danielnelson/gists{/gist_id}","starred_url":"https://api.github.com/users/danielnelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielnelson/subscriptions","organizations_url":"https://api.github.com/users/danielnelson/orgs","repos_url":"https://api.github.com/users/danielnelson/repos","events_url":"https://api.github.com/users/danielnelson/events{/privacy}","received_events_url":"https://api.github.com/users/danielnelson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danielnelson/aiohttp","description":"http client/server for asyncio (PEP-3156)","fork":true,"url":"https://api.github.com/repos/danielnelson/aiohttp","forks_url":"https://api.github.com/repos/danielnelson/aiohttp/forks","keys_url":"https://api.github.com/repos/danielnelson/aiohttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielnelson/aiohttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielnelson/aiohttp/teams","hooks_url":"https://api.github.com/repos/danielnelson/aiohttp/hooks","issue_events_url":"https://api.github.com/repos/danielnelson/aiohttp/issues/events{/number}","events_url":"https://api.github.com/repos/danielnelson/aiohttp/events","assignees_url":"https://api.github.com/repos/danielnelson/aiohttp/assignees{/user}","branches_url":"https://api.github.com/repos/danielnelson/aiohttp/branches{/branch}","tags_url":"https://api.github.com/repos/danielnelson/aiohttp/tags","blobs_url":"https://api.github.com/repos/danielnelson/aiohttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielnelson/aiohttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielnelson/aiohttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielnelson/aiohttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielnelson/aiohttp/statuses/{sha}","languages_url":"https://api.github.com/repos/danielnelson/aiohttp/languages","stargazers_url":"https://api.github.com/repos/danielnelson/aiohttp/stargazers","contributors_url":"https://api.github.com/repos/danielnelson/aiohttp/contributors","subscribers_url":"https://api.github.com/repos/danielnelson/aiohttp/subscribers","subscription_url":"https://api.github.com/repos/danielnelson/aiohttp/subscription","commits_url":"https://api.github.com/repos/danielnelson/aiohttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielnelson/aiohttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielnelson/aiohttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielnelson/aiohttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielnelson/aiohttp/contents/{+path}","compare_url":"https://api.github.com/repos/danielnelson/aiohttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielnelson/aiohttp/merges","archive_url":"https://api.github.com/repos/danielnelson/aiohttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielnelson/aiohttp/downloads","issues_url":"https://api.github.com/repos/danielnelson/aiohttp/issues{/number}","pulls_url":"https://api.github.com/repos/danielnelson/aiohttp/pulls{/number}","milestones_url":"https://api.github.com/repos/danielnelson/aiohttp/milestones{/number}","notifications_url":"https://api.github.com/repos/danielnelson/aiohttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielnelson/aiohttp/labels{/name}","releases_url":"https://api.github.com/repos/danielnelson/aiohttp/releases{/id}","created_at":"2015-05-19T20:53:32Z","updated_at":"2015-05-19T20:53:33Z","pushed_at":"2015-06-11T21:47:26Z","git_url":"git://github.com/danielnelson/aiohttp.git","ssh_url":"git@github.com:danielnelson/aiohttp.git","clone_url":"https://github.com/danielnelson/aiohttp.git","svn_url":"https://github.com/danielnelson/aiohttp","homepage":"http://aiohttp.readthedocs.org","size":2688,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"KeepSafe:master","ref":"master","sha":"8b3d582809442577827d8b808a514d0c3b1a4195","user":{"login":"KeepSafe","id":1377248,"avatar_url":"https://avatars.githubusercontent.com/u/1377248?v=3","gravatar_id":"","url":"https://api.github.com/users/KeepSafe","html_url":"https://github.com/KeepSafe","followers_url":"https://api.github.com/users/KeepSafe/followers","following_url":"https://api.github.com/users/KeepSafe/following{/other_user}","gists_url":"https://api.github.com/users/KeepSafe/gists{/gist_id}","starred_url":"https://api.github.com/users/KeepSafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KeepSafe/subscriptions","organizations_url":"https://api.github.com/users/KeepSafe/orgs","repos_url":"https://api.github.com/users/KeepSafe/repos","events_url":"https://api.github.com/users/KeepSafe/events{/privacy}","received_events_url":"https://api.github.com/users/KeepSafe/received_events","type":"Organization","site_admin":false},"repo":{"id":13258039,"name":"aiohttp","full_name":"KeepSafe/aiohttp","owner":{"login":"KeepSafe","id":1377248,"avatar_url":"https://avatars.githubusercontent.com/u/1377248?v=3","gravatar_id":"","url":"https://api.github.com/users/KeepSafe","html_url":"https://github.com/KeepSafe","followers_url":"https://api.github.com/users/KeepSafe/followers","following_url":"https://api.github.com/users/KeepSafe/following{/other_user}","gists_url":"https://api.github.com/users/KeepSafe/gists{/gist_id}","starred_url":"https://api.github.com/users/KeepSafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KeepSafe/subscriptions","organizations_url":"https://api.github.com/users/KeepSafe/orgs","repos_url":"https://api.github.com/users/KeepSafe/repos","events_url":"https://api.github.com/users/KeepSafe/events{/privacy}","received_events_url":"https://api.github.com/users/KeepSafe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KeepSafe/aiohttp","description":"http client/server for asyncio (PEP-3156)","fork":false,"url":"https://api.github.com/repos/KeepSafe/aiohttp","forks_url":"https://api.github.com/repos/KeepSafe/aiohttp/forks","keys_url":"https://api.github.com/repos/KeepSafe/aiohttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KeepSafe/aiohttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KeepSafe/aiohttp/teams","hooks_url":"https://api.github.com/repos/KeepSafe/aiohttp/hooks","issue_events_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/events{/number}","events_url":"https://api.github.com/repos/KeepSafe/aiohttp/events","assignees_url":"https://api.github.com/repos/KeepSafe/aiohttp/assignees{/user}","branches_url":"https://api.github.com/repos/KeepSafe/aiohttp/branches{/branch}","tags_url":"https://api.github.com/repos/KeepSafe/aiohttp/tags","blobs_url":"https://api.github.com/repos/KeepSafe/aiohttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KeepSafe/aiohttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KeepSafe/aiohttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/KeepSafe/aiohttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KeepSafe/aiohttp/statuses/{sha}","languages_url":"https://api.github.com/repos/KeepSafe/aiohttp/languages","stargazers_url":"https://api.github.com/repos/KeepSafe/aiohttp/stargazers","contributors_url":"https://api.github.com/repos/KeepSafe/aiohttp/contributors","subscribers_url":"https://api.github.com/repos/KeepSafe/aiohttp/subscribers","subscription_url":"https://api.github.com/repos/KeepSafe/aiohttp/subscription","commits_url":"https://api.github.com/repos/KeepSafe/aiohttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/KeepSafe/aiohttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/KeepSafe/aiohttp/contents/{+path}","compare_url":"https://api.github.com/repos/KeepSafe/aiohttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KeepSafe/aiohttp/merges","archive_url":"https://api.github.com/repos/KeepSafe/aiohttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KeepSafe/aiohttp/downloads","issues_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues{/number}","pulls_url":"https://api.github.com/repos/KeepSafe/aiohttp/pulls{/number}","milestones_url":"https://api.github.com/repos/KeepSafe/aiohttp/milestones{/number}","notifications_url":"https://api.github.com/repos/KeepSafe/aiohttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KeepSafe/aiohttp/labels{/name}","releases_url":"https://api.github.com/repos/KeepSafe/aiohttp/releases{/id}","created_at":"2013-10-01T23:04:01Z","updated_at":"2015-06-11T23:18:12Z","pushed_at":"2015-06-11T21:47:27Z","git_url":"git://github.com/KeepSafe/aiohttp.git","ssh_url":"git@github.com:KeepSafe/aiohttp.git","clone_url":"https://github.com/KeepSafe/aiohttp.git","svn_url":"https://github.com/KeepSafe/aiohttp","homepage":"http://aiohttp.readthedocs.org","size":6831,"stargazers_count":804,"watchers_count":804,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":132,"mirror_url":null,"open_issues_count":34,"forks":132,"open_issues":34,"watchers":804,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403"},"html":{"href":"https://github.com/KeepSafe/aiohttp/pull/403"},"issue":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/issues/403"},"comments":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/issues/403/comments"},"review_comments":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403/comments"},"review_comment":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/pulls/403/commits"},"statuses":{"href":"https://api.github.com/repos/KeepSafe/aiohttp/statuses/275dbac47b55a853e8b61557ef5190739b173931"}}}}