{"action":"created","issue":{"url":"https://api.github.com/repos/zkat/make-fetch-happen/issues/46","repository_url":"https://api.github.com/repos/zkat/make-fetch-happen","labels_url":"https://api.github.com/repos/zkat/make-fetch-happen/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/zkat/make-fetch-happen/issues/46/comments","events_url":"https://api.github.com/repos/zkat/make-fetch-happen/issues/46/events","html_url":"https://github.com/zkat/make-fetch-happen/issues/46","id":264854021,"number":46,"title":"Setting headers does not give 304 and result from cache with identical requests","user":{"login":"arve0","id":4810521,"avatar_url":"https://avatars2.githubusercontent.com/u/4810521?v=4","gravatar_id":"","url":"https://api.github.com/users/arve0","html_url":"https://github.com/arve0","followers_url":"https://api.github.com/users/arve0/followers","following_url":"https://api.github.com/users/arve0/following{/other_user}","gists_url":"https://api.github.com/users/arve0/gists{/gist_id}","starred_url":"https://api.github.com/users/arve0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arve0/subscriptions","organizations_url":"https://api.github.com/users/arve0/orgs","repos_url":"https://api.github.com/users/arve0/repos","events_url":"https://api.github.com/users/arve0/events{/privacy}","received_events_url":"https://api.github.com/users/arve0/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-12T08:25:36Z","updated_at":"2017-10-13T07:36:24Z","closed_at":"2017-10-12T13:53:41Z","author_association":"NONE","body":"Setting when setting headers, m-f-h does not resolve request from cache:\r\n\r\n```js\r\nconst fetch = require('make-fetch-happen').defaults({\r\n  cacheManager: './my-cache' // path where cache will be written (and read)\r\n})\r\n\r\nlet options = {\r\n  headers: {\r\n    Accept: 'application/vnd.npm.install-v1+json'\r\n  }\r\n}\r\n\r\nfetch('https://registry.npmjs.org/make-fetch-happen', options).then(res => {\r\n  console.log(res.status)\r\n  return res.json() // download the body as JSON\r\n}).then(body => {\r\n  console.log(`got ${body.name} from web`)\r\n  return fetch('https://registry.npmjs.org/make-fetch-happen', {\r\n    ...options,\r\n    cache: 'no-cache' // forces a conditional request\r\n  })\r\n}).then(res => {\r\n  console.log(res.status) // 304! cache validated!\r\n  return res.json().then(body => {\r\n    console.log(`got ${body.name} from cache`)\r\n  })\r\n})\r\n```\r\nOutput\r\n```\r\n200\r\ngot make-fetch-happen from web\r\n200\r\ngot make-fetch-happen from cache\r\n```\r\n[runkit](https://runkit.com/embed/w0kninu16ie7)\r\n\r\nIs this normal?"},"comment":{"url":"https://api.github.com/repos/zkat/make-fetch-happen/issues/comments/336374836","html_url":"https://github.com/zkat/make-fetch-happen/issues/46#issuecomment-336374836","issue_url":"https://api.github.com/repos/zkat/make-fetch-happen/issues/46","id":336374836,"user":{"login":"SimenB","id":1404810,"avatar_url":"https://avatars1.githubusercontent.com/u/1404810?v=4","gravatar_id":"","url":"https://api.github.com/users/SimenB","html_url":"https://github.com/SimenB","followers_url":"https://api.github.com/users/SimenB/followers","following_url":"https://api.github.com/users/SimenB/following{/other_user}","gists_url":"https://api.github.com/users/SimenB/gists{/gist_id}","starred_url":"https://api.github.com/users/SimenB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimenB/subscriptions","organizations_url":"https://api.github.com/users/SimenB/orgs","repos_url":"https://api.github.com/users/SimenB/repos","events_url":"https://api.github.com/users/SimenB/events{/privacy}","received_events_url":"https://api.github.com/users/SimenB/received_events","type":"User","site_admin":false},"created_at":"2017-10-13T07:36:24Z","updated_at":"2017-10-13T07:36:24Z","author_association":"NONE","body":"It's a bug, isn't it? Http headers are AFAIK case-insensitive."}}
{"actor":{"display_login":"SimenB"}}