{"action":"created","comment":{"url":"https://api.github.com/repos/shazow/urllib3/pulls/comments/25850105","id":25850105,"diff_hunk":"@@ -148,11 +149,18 @@ def __init__(self, headers=None, **kwargs):\n             self.extend(kwargs)\n \n     def __setitem__(self, key, val):\n-        return _dict_setitem(self, key.lower(), (key, val))\n+        if key in self:\n+            del self[key]\n+        self.add(key, val)\n+        return val\n \n     def __getitem__(self, key):\n-        val = _dict_getitem(self, key.lower())\n-        return ', '.join(val[1:])\n+        key_lower = key.lower()\n+        _, values = _dict_getitem(self, key_lower)\n+        if key_lower in SPECIAL_CASE_MULTIPLE_HEADERS:\n+            # NOTE(sigmavirus24): Should we return something else?","path":"urllib3/_collections.py","position":26,"original_position":26,"commit_id":"995a8b99324c092d1e0fb91a2ee51ea6a1606a22","original_commit_id":"995a8b99324c092d1e0fb91a2ee51ea6a1606a22","user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"body":"Maybe a list, but in practice I think that's breaky.","created_at":"2015-03-05T09:30:44Z","updated_at":"2015-03-05T09:30:44Z","html_url":"https://github.com/shazow/urllib3/pull/562#discussion_r25850105","pull_request_url":"https://api.github.com/repos/shazow/urllib3/pulls/562","_links":{"self":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/comments/25850105"},"html":{"href":"https://github.com/shazow/urllib3/pull/562#discussion_r25850105"},"pull_request":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/shazow/urllib3/pulls/562","id":30515321,"html_url":"https://github.com/shazow/urllib3/pull/562","diff_url":"https://github.com/shazow/urllib3/pull/562.diff","patch_url":"https://github.com/shazow/urllib3/pull/562.patch","issue_url":"https://api.github.com/repos/shazow/urllib3/issues/562","number":562,"state":"open","locked":false,"title":"Fix HTTPHeaderDict implementation for multiple headers","user":{"login":"sigmavirus24","id":240830,"avatar_url":"https://avatars.githubusercontent.com/u/240830?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmavirus24","html_url":"https://github.com/sigmavirus24","followers_url":"https://api.github.com/users/sigmavirus24/followers","following_url":"https://api.github.com/users/sigmavirus24/following{/other_user}","gists_url":"https://api.github.com/users/sigmavirus24/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmavirus24/subscriptions","organizations_url":"https://api.github.com/users/sigmavirus24/orgs","repos_url":"https://api.github.com/users/sigmavirus24/repos","events_url":"https://api.github.com/users/sigmavirus24/events{/privacy}","received_events_url":"https://api.github.com/users/sigmavirus24/received_events","type":"User","site_admin":false},"body":"- Allow all headers to have multiple values\r\n- Special-case how cookie, set-cookie, and set-cookie2 are presented/handled\r\n- Trim some extraneous whitespace\r\n\r\nFixes #561","created_at":"2015-03-04T23:20:48Z","updated_at":"2015-03-05T09:30:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d12566154387bb3234cf752890ff6f0738fc1015","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shazow/urllib3/pulls/562/commits","review_comments_url":"https://api.github.com/repos/shazow/urllib3/pulls/562/comments","review_comment_url":"https://api.github.com/repos/shazow/urllib3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shazow/urllib3/issues/562/comments","statuses_url":"https://api.github.com/repos/shazow/urllib3/statuses/995a8b99324c092d1e0fb91a2ee51ea6a1606a22","head":{"label":"sigmavirus24:bug/561","ref":"bug/561","sha":"995a8b99324c092d1e0fb91a2ee51ea6a1606a22","user":{"login":"sigmavirus24","id":240830,"avatar_url":"https://avatars.githubusercontent.com/u/240830?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmavirus24","html_url":"https://github.com/sigmavirus24","followers_url":"https://api.github.com/users/sigmavirus24/followers","following_url":"https://api.github.com/users/sigmavirus24/following{/other_user}","gists_url":"https://api.github.com/users/sigmavirus24/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmavirus24/subscriptions","organizations_url":"https://api.github.com/users/sigmavirus24/orgs","repos_url":"https://api.github.com/users/sigmavirus24/repos","events_url":"https://api.github.com/users/sigmavirus24/events{/privacy}","received_events_url":"https://api.github.com/users/sigmavirus24/received_events","type":"User","site_admin":false},"repo":{"id":14912894,"name":"urllib3","full_name":"sigmavirus24/urllib3","owner":{"login":"sigmavirus24","id":240830,"avatar_url":"https://avatars.githubusercontent.com/u/240830?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmavirus24","html_url":"https://github.com/sigmavirus24","followers_url":"https://api.github.com/users/sigmavirus24/followers","following_url":"https://api.github.com/users/sigmavirus24/following{/other_user}","gists_url":"https://api.github.com/users/sigmavirus24/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmavirus24/subscriptions","organizations_url":"https://api.github.com/users/sigmavirus24/orgs","repos_url":"https://api.github.com/users/sigmavirus24/repos","events_url":"https://api.github.com/users/sigmavirus24/events{/privacy}","received_events_url":"https://api.github.com/users/sigmavirus24/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sigmavirus24/urllib3","description":"Python HTTP library with thread-safe connection pooling, file post support, sanity friendly, and more.","fork":true,"url":"https://api.github.com/repos/sigmavirus24/urllib3","forks_url":"https://api.github.com/repos/sigmavirus24/urllib3/forks","keys_url":"https://api.github.com/repos/sigmavirus24/urllib3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sigmavirus24/urllib3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sigmavirus24/urllib3/teams","hooks_url":"https://api.github.com/repos/sigmavirus24/urllib3/hooks","issue_events_url":"https://api.github.com/repos/sigmavirus24/urllib3/issues/events{/number}","events_url":"https://api.github.com/repos/sigmavirus24/urllib3/events","assignees_url":"https://api.github.com/repos/sigmavirus24/urllib3/assignees{/user}","branches_url":"https://api.github.com/repos/sigmavirus24/urllib3/branches{/branch}","tags_url":"https://api.github.com/repos/sigmavirus24/urllib3/tags","blobs_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/refs{/sha}","trees_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sigmavirus24/urllib3/statuses/{sha}","languages_url":"https://api.github.com/repos/sigmavirus24/urllib3/languages","stargazers_url":"https://api.github.com/repos/sigmavirus24/urllib3/stargazers","contributors_url":"https://api.github.com/repos/sigmavirus24/urllib3/contributors","subscribers_url":"https://api.github.com/repos/sigmavirus24/urllib3/subscribers","subscription_url":"https://api.github.com/repos/sigmavirus24/urllib3/subscription","commits_url":"https://api.github.com/repos/sigmavirus24/urllib3/commits{/sha}","git_commits_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/commits{/sha}","comments_url":"https://api.github.com/repos/sigmavirus24/urllib3/comments{/number}","issue_comment_url":"https://api.github.com/repos/sigmavirus24/urllib3/issues/comments{/number}","contents_url":"https://api.github.com/repos/sigmavirus24/urllib3/contents/{+path}","compare_url":"https://api.github.com/repos/sigmavirus24/urllib3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sigmavirus24/urllib3/merges","archive_url":"https://api.github.com/repos/sigmavirus24/urllib3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sigmavirus24/urllib3/downloads","issues_url":"https://api.github.com/repos/sigmavirus24/urllib3/issues{/number}","pulls_url":"https://api.github.com/repos/sigmavirus24/urllib3/pulls{/number}","milestones_url":"https://api.github.com/repos/sigmavirus24/urllib3/milestones{/number}","notifications_url":"https://api.github.com/repos/sigmavirus24/urllib3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sigmavirus24/urllib3/labels{/name}","releases_url":"https://api.github.com/repos/sigmavirus24/urllib3/releases{/id}","created_at":"2013-12-04T03:04:13Z","updated_at":"2015-03-04T22:40:00Z","pushed_at":"2015-03-05T03:36:55Z","git_url":"git://github.com/sigmavirus24/urllib3.git","ssh_url":"git@github.com:sigmavirus24/urllib3.git","clone_url":"https://github.com/sigmavirus24/urllib3.git","svn_url":"https://github.com/sigmavirus24/urllib3","homepage":"http://urllib3.readthedocs.org/","size":2442,"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":"shazow:master","ref":"master","sha":"6f0d66e75ec33b2c809e9d63caa7355741ceeed7","user":{"login":"shazow","id":6292,"avatar_url":"https://avatars.githubusercontent.com/u/6292?v=3","gravatar_id":"","url":"https://api.github.com/users/shazow","html_url":"https://github.com/shazow","followers_url":"https://api.github.com/users/shazow/followers","following_url":"https://api.github.com/users/shazow/following{/other_user}","gists_url":"https://api.github.com/users/shazow/gists{/gist_id}","starred_url":"https://api.github.com/users/shazow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazow/subscriptions","organizations_url":"https://api.github.com/users/shazow/orgs","repos_url":"https://api.github.com/users/shazow/repos","events_url":"https://api.github.com/users/shazow/events{/privacy}","received_events_url":"https://api.github.com/users/shazow/received_events","type":"User","site_admin":false},"repo":{"id":2410676,"name":"urllib3","full_name":"shazow/urllib3","owner":{"login":"shazow","id":6292,"avatar_url":"https://avatars.githubusercontent.com/u/6292?v=3","gravatar_id":"","url":"https://api.github.com/users/shazow","html_url":"https://github.com/shazow","followers_url":"https://api.github.com/users/shazow/followers","following_url":"https://api.github.com/users/shazow/following{/other_user}","gists_url":"https://api.github.com/users/shazow/gists{/gist_id}","starred_url":"https://api.github.com/users/shazow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazow/subscriptions","organizations_url":"https://api.github.com/users/shazow/orgs","repos_url":"https://api.github.com/users/shazow/repos","events_url":"https://api.github.com/users/shazow/events{/privacy}","received_events_url":"https://api.github.com/users/shazow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shazow/urllib3","description":"Python HTTP library with thread-safe connection pooling, file post support, sanity friendly, and more.","fork":false,"url":"https://api.github.com/repos/shazow/urllib3","forks_url":"https://api.github.com/repos/shazow/urllib3/forks","keys_url":"https://api.github.com/repos/shazow/urllib3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shazow/urllib3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shazow/urllib3/teams","hooks_url":"https://api.github.com/repos/shazow/urllib3/hooks","issue_events_url":"https://api.github.com/repos/shazow/urllib3/issues/events{/number}","events_url":"https://api.github.com/repos/shazow/urllib3/events","assignees_url":"https://api.github.com/repos/shazow/urllib3/assignees{/user}","branches_url":"https://api.github.com/repos/shazow/urllib3/branches{/branch}","tags_url":"https://api.github.com/repos/shazow/urllib3/tags","blobs_url":"https://api.github.com/repos/shazow/urllib3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shazow/urllib3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shazow/urllib3/git/refs{/sha}","trees_url":"https://api.github.com/repos/shazow/urllib3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shazow/urllib3/statuses/{sha}","languages_url":"https://api.github.com/repos/shazow/urllib3/languages","stargazers_url":"https://api.github.com/repos/shazow/urllib3/stargazers","contributors_url":"https://api.github.com/repos/shazow/urllib3/contributors","subscribers_url":"https://api.github.com/repos/shazow/urllib3/subscribers","subscription_url":"https://api.github.com/repos/shazow/urllib3/subscription","commits_url":"https://api.github.com/repos/shazow/urllib3/commits{/sha}","git_commits_url":"https://api.github.com/repos/shazow/urllib3/git/commits{/sha}","comments_url":"https://api.github.com/repos/shazow/urllib3/comments{/number}","issue_comment_url":"https://api.github.com/repos/shazow/urllib3/issues/comments{/number}","contents_url":"https://api.github.com/repos/shazow/urllib3/contents/{+path}","compare_url":"https://api.github.com/repos/shazow/urllib3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shazow/urllib3/merges","archive_url":"https://api.github.com/repos/shazow/urllib3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shazow/urllib3/downloads","issues_url":"https://api.github.com/repos/shazow/urllib3/issues{/number}","pulls_url":"https://api.github.com/repos/shazow/urllib3/pulls{/number}","milestones_url":"https://api.github.com/repos/shazow/urllib3/milestones{/number}","notifications_url":"https://api.github.com/repos/shazow/urllib3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shazow/urllib3/labels{/name}","releases_url":"https://api.github.com/repos/shazow/urllib3/releases{/id}","created_at":"2011-09-18T18:08:28Z","updated_at":"2015-03-03T20:24:47Z","pushed_at":"2015-03-03T20:24:47Z","git_url":"git://github.com/shazow/urllib3.git","ssh_url":"git@github.com:shazow/urllib3.git","clone_url":"https://github.com/shazow/urllib3.git","svn_url":"https://github.com/shazow/urllib3","homepage":"http://urllib3.readthedocs.org/","size":5082,"stargazers_count":790,"watchers_count":790,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":231,"mirror_url":null,"open_issues_count":58,"forks":231,"open_issues":58,"watchers":790,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/562"},"html":{"href":"https://github.com/shazow/urllib3/pull/562"},"issue":{"href":"https://api.github.com/repos/shazow/urllib3/issues/562"},"comments":{"href":"https://api.github.com/repos/shazow/urllib3/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/shazow/urllib3/statuses/995a8b99324c092d1e0fb91a2ee51ea6a1606a22"}}}}