{"action":"opened","number":613,"pull_request":{"url":"https://api.github.com/repos/sindresorhus/got/pulls/613","id":215601793,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NjAxNzkz","html_url":"https://github.com/sindresorhus/got/pull/613","diff_url":"https://github.com/sindresorhus/got/pull/613.diff","patch_url":"https://github.com/sindresorhus/got/pull/613.patch","issue_url":"https://api.github.com/repos/sindresorhus/got/issues/613","number":613,"state":"open","locked":false,"title":"Lowercase user set headers","user":{"login":"alextes","id":2011351,"node_id":"MDQ6VXNlcjIwMTEzNTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2011351?v=4","gravatar_id":"","url":"https://api.github.com/users/alextes","html_url":"https://github.com/alextes","followers_url":"https://api.github.com/users/alextes/followers","following_url":"https://api.github.com/users/alextes/following{/other_user}","gists_url":"https://api.github.com/users/alextes/gists{/gist_id}","starred_url":"https://api.github.com/users/alextes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextes/subscriptions","organizations_url":"https://api.github.com/users/alextes/orgs","repos_url":"https://api.github.com/users/alextes/repos","events_url":"https://api.github.com/users/alextes/events{/privacy}","received_events_url":"https://api.github.com/users/alextes/received_events","type":"User","site_admin":false},"body":"There's one thing that should happen which is to lowercase all the headers passed so no duplicate lowercase keys can exist. Because 1. we have logic that reads and writes headers, but 2. we have no clue what node will do when we pass it duplicate header keys.\r\n\r\nThe reason this is hard to test is that we use `cacheable-request` and by the time the `request` event fires the headers have already been merged, with keys set later in time overwriting ones set earlier in time. So I test by setting some header in uppercase I know with got's current implementation is followed by a key set in lowercase before everything is passed to `cacheable-request`. That's brittle. If someone has a better idea let me know.\r\n\r\nFixes #612 .","created_at":"2018-09-14T13:53:34Z","updated_at":"2018-09-14T13:53:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/got/pulls/613/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/got/pulls/613/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/got/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/got/issues/613/comments","statuses_url":"https://api.github.com/repos/sindresorhus/got/statuses/cd81c5813e185b4d4d899f983d61b0e104f0f5ef","head":{"label":"alextes:lowercase-headers","ref":"lowercase-headers","sha":"cd81c5813e185b4d4d899f983d61b0e104f0f5ef","user":{"login":"alextes","id":2011351,"node_id":"MDQ6VXNlcjIwMTEzNTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2011351?v=4","gravatar_id":"","url":"https://api.github.com/users/alextes","html_url":"https://github.com/alextes","followers_url":"https://api.github.com/users/alextes/followers","following_url":"https://api.github.com/users/alextes/following{/other_user}","gists_url":"https://api.github.com/users/alextes/gists{/gist_id}","starred_url":"https://api.github.com/users/alextes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextes/subscriptions","organizations_url":"https://api.github.com/users/alextes/orgs","repos_url":"https://api.github.com/users/alextes/repos","events_url":"https://api.github.com/users/alextes/events{/privacy}","received_events_url":"https://api.github.com/users/alextes/received_events","type":"User","site_admin":false},"repo":{"id":75483926,"node_id":"MDEwOlJlcG9zaXRvcnk3NTQ4MzkyNg==","name":"got","full_name":"alextes/got","owner":{"login":"alextes","id":2011351,"node_id":"MDQ6VXNlcjIwMTEzNTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2011351?v=4","gravatar_id":"","url":"https://api.github.com/users/alextes","html_url":"https://github.com/alextes","followers_url":"https://api.github.com/users/alextes/followers","following_url":"https://api.github.com/users/alextes/following{/other_user}","gists_url":"https://api.github.com/users/alextes/gists{/gist_id}","starred_url":"https://api.github.com/users/alextes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextes/subscriptions","organizations_url":"https://api.github.com/users/alextes/orgs","repos_url":"https://api.github.com/users/alextes/repos","events_url":"https://api.github.com/users/alextes/events{/privacy}","received_events_url":"https://api.github.com/users/alextes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alextes/got","description":"Simplified HTTP requests","fork":true,"url":"https://api.github.com/repos/alextes/got","forks_url":"https://api.github.com/repos/alextes/got/forks","keys_url":"https://api.github.com/repos/alextes/got/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alextes/got/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alextes/got/teams","hooks_url":"https://api.github.com/repos/alextes/got/hooks","issue_events_url":"https://api.github.com/repos/alextes/got/issues/events{/number}","events_url":"https://api.github.com/repos/alextes/got/events","assignees_url":"https://api.github.com/repos/alextes/got/assignees{/user}","branches_url":"https://api.github.com/repos/alextes/got/branches{/branch}","tags_url":"https://api.github.com/repos/alextes/got/tags","blobs_url":"https://api.github.com/repos/alextes/got/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alextes/got/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alextes/got/git/refs{/sha}","trees_url":"https://api.github.com/repos/alextes/got/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alextes/got/statuses/{sha}","languages_url":"https://api.github.com/repos/alextes/got/languages","stargazers_url":"https://api.github.com/repos/alextes/got/stargazers","contributors_url":"https://api.github.com/repos/alextes/got/contributors","subscribers_url":"https://api.github.com/repos/alextes/got/subscribers","subscription_url":"https://api.github.com/repos/alextes/got/subscription","commits_url":"https://api.github.com/repos/alextes/got/commits{/sha}","git_commits_url":"https://api.github.com/repos/alextes/got/git/commits{/sha}","comments_url":"https://api.github.com/repos/alextes/got/comments{/number}","issue_comment_url":"https://api.github.com/repos/alextes/got/issues/comments{/number}","contents_url":"https://api.github.com/repos/alextes/got/contents/{+path}","compare_url":"https://api.github.com/repos/alextes/got/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alextes/got/merges","archive_url":"https://api.github.com/repos/alextes/got/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alextes/got/downloads","issues_url":"https://api.github.com/repos/alextes/got/issues{/number}","pulls_url":"https://api.github.com/repos/alextes/got/pulls{/number}","milestones_url":"https://api.github.com/repos/alextes/got/milestones{/number}","notifications_url":"https://api.github.com/repos/alextes/got/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alextes/got/labels{/name}","releases_url":"https://api.github.com/repos/alextes/got/releases{/id}","deployments_url":"https://api.github.com/repos/alextes/got/deployments","created_at":"2016-12-03T16:01:49Z","updated_at":"2018-09-14T13:45:28Z","pushed_at":"2018-09-14T13:45:25Z","git_url":"git://github.com/alextes/got.git","ssh_url":"git@github.com:alextes/got.git","clone_url":"https://github.com/alextes/got.git","svn_url":"https://github.com/alextes/got","homepage":"","size":976,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"sindresorhus:master","ref":"master","sha":"3ad39508f86c30aa5d2dea791aa90613b38e8ec1","user":{"login":"sindresorhus","id":170270,"node_id":"MDQ6VXNlcjE3MDI3MA==","avatar_url":"https://avatars1.githubusercontent.com/u/170270?v=4","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":18193978,"node_id":"MDEwOlJlcG9zaXRvcnkxODE5Mzk3OA==","name":"got","full_name":"sindresorhus/got","owner":{"login":"sindresorhus","id":170270,"node_id":"MDQ6VXNlcjE3MDI3MA==","avatar_url":"https://avatars1.githubusercontent.com/u/170270?v=4","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/got","description":"Simplified HTTP requests","fork":false,"url":"https://api.github.com/repos/sindresorhus/got","forks_url":"https://api.github.com/repos/sindresorhus/got/forks","keys_url":"https://api.github.com/repos/sindresorhus/got/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/got/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/got/teams","hooks_url":"https://api.github.com/repos/sindresorhus/got/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/got/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/got/events","assignees_url":"https://api.github.com/repos/sindresorhus/got/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/got/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/got/tags","blobs_url":"https://api.github.com/repos/sindresorhus/got/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/got/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/got/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/got/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/got/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/got/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/got/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/got/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/got/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/got/subscription","commits_url":"https://api.github.com/repos/sindresorhus/got/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/got/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/got/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/got/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/got/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/got/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/got/merges","archive_url":"https://api.github.com/repos/sindresorhus/got/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/got/downloads","issues_url":"https://api.github.com/repos/sindresorhus/got/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/got/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/got/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/got/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/got/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/got/releases{/id}","deployments_url":"https://api.github.com/repos/sindresorhus/got/deployments","created_at":"2014-03-27T22:40:49Z","updated_at":"2018-09-14T10:18:05Z","pushed_at":"2018-09-13T18:33:12Z","git_url":"git://github.com/sindresorhus/got.git","ssh_url":"git@github.com:sindresorhus/got.git","clone_url":"https://github.com/sindresorhus/got.git","svn_url":"https://github.com/sindresorhus/got","homepage":"","size":1110,"stargazers_count":4098,"watchers_count":4098,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":218,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":218,"open_issues":11,"watchers":4098,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/got/pulls/613"},"html":{"href":"https://github.com/sindresorhus/got/pull/613"},"issue":{"href":"https://api.github.com/repos/sindresorhus/got/issues/613"},"comments":{"href":"https://api.github.com/repos/sindresorhus/got/issues/613/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/got/pulls/613/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/got/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/got/pulls/613/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/got/statuses/cd81c5813e185b4d4d899f983d61b0e104f0f5ef"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":2,"additions":10,"deletions":3,"changed_files":3}}
{"actor":{"display_login":"alextes"}}