{"action":"created","comment":{"url":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/comments/74598829","id":74598829,"diff_hunk":"@@ -38,7 +38,11 @@ def initialize(payload = {})\n         @now = Time.now\n         @payload = payload\n         wrap_headers!\n-        headers['Date'] ||= @now.httpdate\n+        begin","path":"lib/faraday/http_cache/response.rb","position":5,"original_position":5,"commit_id":"8aa33a390f7ec8e5e8271f4888d43a8a9694a6d7","original_commit_id":"8aa33a390f7ec8e5e8271f4888d43a8a9694a6d7","user":{"login":"lucasmazza","id":80978,"avatar_url":"https://avatars.githubusercontent.com/u/80978?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasmazza","html_url":"https://github.com/lucasmazza","followers_url":"https://api.github.com/users/lucasmazza/followers","following_url":"https://api.github.com/users/lucasmazza/following{/other_user}","gists_url":"https://api.github.com/users/lucasmazza/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasmazza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasmazza/subscriptions","organizations_url":"https://api.github.com/users/lucasmazza/orgs","repos_url":"https://api.github.com/users/lucasmazza/repos","events_url":"https://api.github.com/users/lucasmazza/events{/privacy}","received_events_url":"https://api.github.com/users/lucasmazza/received_events","type":"User","site_admin":false},"body":"the goal if this `begin` + `rescue` block is to do something on the lines of \"Try to parse the `Date` header, if it fails set it to `@now`, right? I think it's worth to push it to a private method like `ensure_date_header` so we know that it's a required step on processing a response on our side.","created_at":"2016-08-12T14:21:59Z","updated_at":"2016-08-12T14:21:59Z","html_url":"https://github.com/plataformatec/faraday-http-cache/pull/87#discussion_r74598829","pull_request_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/comments/74598829"},"html":{"href":"https://github.com/plataformatec/faraday-http-cache/pull/87#discussion_r74598829"},"pull_request":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87","id":80995754,"html_url":"https://github.com/plataformatec/faraday-http-cache/pull/87","diff_url":"https://github.com/plataformatec/faraday-http-cache/pull/87.diff","patch_url":"https://github.com/plataformatec/faraday-http-cache/pull/87.patch","issue_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/issues/87","number":87,"state":"open","locked":false,"title":"Added error checking for invalid Date response header","user":{"login":"charliehan","id":1420966,"avatar_url":"https://avatars.githubusercontent.com/u/1420966?v=3","gravatar_id":"","url":"https://api.github.com/users/charliehan","html_url":"https://github.com/charliehan","followers_url":"https://api.github.com/users/charliehan/followers","following_url":"https://api.github.com/users/charliehan/following{/other_user}","gists_url":"https://api.github.com/users/charliehan/gists{/gist_id}","starred_url":"https://api.github.com/users/charliehan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charliehan/subscriptions","organizations_url":"https://api.github.com/users/charliehan/orgs","repos_url":"https://api.github.com/users/charliehan/repos","events_url":"https://api.github.com/users/charliehan/events{/privacy}","received_events_url":"https://api.github.com/users/charliehan/received_events","type":"User","site_admin":false},"body":"and more logging for fetched/cached response headers.\r\n\r\nI've encountered a site where the 'Date' response header was corrupted (it had the Date string duplicated/joined with a comma: e.g. \"Thu, 11 Aug 2016 04:58:24 GMT, Thu, 11 Aug 2016 04:58:24 GMT\"). Though this should be a rare case, this commit prevents the response from throwing a \"not RFC 2616 compliant date\" error when the 'Date' header is invalid.","created_at":"2016-08-11T17:18:36Z","updated_at":"2016-08-12T14:21:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bf52249e215975c36f963eabbb453ad308303dd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87/commits","review_comments_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87/comments","review_comment_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/issues/87/comments","statuses_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/statuses/8aa33a390f7ec8e5e8271f4888d43a8a9694a6d7","head":{"label":"charliehan:master","ref":"master","sha":"8aa33a390f7ec8e5e8271f4888d43a8a9694a6d7","user":{"login":"charliehan","id":1420966,"avatar_url":"https://avatars.githubusercontent.com/u/1420966?v=3","gravatar_id":"","url":"https://api.github.com/users/charliehan","html_url":"https://github.com/charliehan","followers_url":"https://api.github.com/users/charliehan/followers","following_url":"https://api.github.com/users/charliehan/following{/other_user}","gists_url":"https://api.github.com/users/charliehan/gists{/gist_id}","starred_url":"https://api.github.com/users/charliehan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charliehan/subscriptions","organizations_url":"https://api.github.com/users/charliehan/orgs","repos_url":"https://api.github.com/users/charliehan/repos","events_url":"https://api.github.com/users/charliehan/events{/privacy}","received_events_url":"https://api.github.com/users/charliehan/received_events","type":"User","site_admin":false},"repo":{"id":36511505,"name":"faraday-http-cache","full_name":"charliehan/faraday-http-cache","owner":{"login":"charliehan","id":1420966,"avatar_url":"https://avatars.githubusercontent.com/u/1420966?v=3","gravatar_id":"","url":"https://api.github.com/users/charliehan","html_url":"https://github.com/charliehan","followers_url":"https://api.github.com/users/charliehan/followers","following_url":"https://api.github.com/users/charliehan/following{/other_user}","gists_url":"https://api.github.com/users/charliehan/gists{/gist_id}","starred_url":"https://api.github.com/users/charliehan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charliehan/subscriptions","organizations_url":"https://api.github.com/users/charliehan/orgs","repos_url":"https://api.github.com/users/charliehan/repos","events_url":"https://api.github.com/users/charliehan/events{/privacy}","received_events_url":"https://api.github.com/users/charliehan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/charliehan/faraday-http-cache","description":"a faraday middleware that respects HTTP cache","fork":true,"url":"https://api.github.com/repos/charliehan/faraday-http-cache","forks_url":"https://api.github.com/repos/charliehan/faraday-http-cache/forks","keys_url":"https://api.github.com/repos/charliehan/faraday-http-cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/charliehan/faraday-http-cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/charliehan/faraday-http-cache/teams","hooks_url":"https://api.github.com/repos/charliehan/faraday-http-cache/hooks","issue_events_url":"https://api.github.com/repos/charliehan/faraday-http-cache/issues/events{/number}","events_url":"https://api.github.com/repos/charliehan/faraday-http-cache/events","assignees_url":"https://api.github.com/repos/charliehan/faraday-http-cache/assignees{/user}","branches_url":"https://api.github.com/repos/charliehan/faraday-http-cache/branches{/branch}","tags_url":"https://api.github.com/repos/charliehan/faraday-http-cache/tags","blobs_url":"https://api.github.com/repos/charliehan/faraday-http-cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/charliehan/faraday-http-cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/charliehan/faraday-http-cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/charliehan/faraday-http-cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/charliehan/faraday-http-cache/statuses/{sha}","languages_url":"https://api.github.com/repos/charliehan/faraday-http-cache/languages","stargazers_url":"https://api.github.com/repos/charliehan/faraday-http-cache/stargazers","contributors_url":"https://api.github.com/repos/charliehan/faraday-http-cache/contributors","subscribers_url":"https://api.github.com/repos/charliehan/faraday-http-cache/subscribers","subscription_url":"https://api.github.com/repos/charliehan/faraday-http-cache/subscription","commits_url":"https://api.github.com/repos/charliehan/faraday-http-cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/charliehan/faraday-http-cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/charliehan/faraday-http-cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/charliehan/faraday-http-cache/issues/comments{/number}","contents_url":"https://api.github.com/repos/charliehan/faraday-http-cache/contents/{+path}","compare_url":"https://api.github.com/repos/charliehan/faraday-http-cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/charliehan/faraday-http-cache/merges","archive_url":"https://api.github.com/repos/charliehan/faraday-http-cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/charliehan/faraday-http-cache/downloads","issues_url":"https://api.github.com/repos/charliehan/faraday-http-cache/issues{/number}","pulls_url":"https://api.github.com/repos/charliehan/faraday-http-cache/pulls{/number}","milestones_url":"https://api.github.com/repos/charliehan/faraday-http-cache/milestones{/number}","notifications_url":"https://api.github.com/repos/charliehan/faraday-http-cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/charliehan/faraday-http-cache/labels{/name}","releases_url":"https://api.github.com/repos/charliehan/faraday-http-cache/releases{/id}","deployments_url":"https://api.github.com/repos/charliehan/faraday-http-cache/deployments","created_at":"2015-05-29T15:08:04Z","updated_at":"2016-08-10T18:01:23Z","pushed_at":"2016-08-11T18:43:12Z","git_url":"git://github.com/charliehan/faraday-http-cache.git","ssh_url":"git@github.com:charliehan/faraday-http-cache.git","clone_url":"https://github.com/charliehan/faraday-http-cache.git","svn_url":"https://github.com/charliehan/faraday-http-cache","homepage":"","size":351,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"plataformatec:master","ref":"master","sha":"17526d16b00dfade2a4a9f530142cebe7e150e8f","user":{"login":"plataformatec","id":127679,"avatar_url":"https://avatars.githubusercontent.com/u/127679?v=3","gravatar_id":"","url":"https://api.github.com/users/plataformatec","html_url":"https://github.com/plataformatec","followers_url":"https://api.github.com/users/plataformatec/followers","following_url":"https://api.github.com/users/plataformatec/following{/other_user}","gists_url":"https://api.github.com/users/plataformatec/gists{/gist_id}","starred_url":"https://api.github.com/users/plataformatec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plataformatec/subscriptions","organizations_url":"https://api.github.com/users/plataformatec/orgs","repos_url":"https://api.github.com/users/plataformatec/repos","events_url":"https://api.github.com/users/plataformatec/events{/privacy}","received_events_url":"https://api.github.com/users/plataformatec/received_events","type":"Organization","site_admin":false},"repo":{"id":3378613,"name":"faraday-http-cache","full_name":"plataformatec/faraday-http-cache","owner":{"login":"plataformatec","id":127679,"avatar_url":"https://avatars.githubusercontent.com/u/127679?v=3","gravatar_id":"","url":"https://api.github.com/users/plataformatec","html_url":"https://github.com/plataformatec","followers_url":"https://api.github.com/users/plataformatec/followers","following_url":"https://api.github.com/users/plataformatec/following{/other_user}","gists_url":"https://api.github.com/users/plataformatec/gists{/gist_id}","starred_url":"https://api.github.com/users/plataformatec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plataformatec/subscriptions","organizations_url":"https://api.github.com/users/plataformatec/orgs","repos_url":"https://api.github.com/users/plataformatec/repos","events_url":"https://api.github.com/users/plataformatec/events{/privacy}","received_events_url":"https://api.github.com/users/plataformatec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plataformatec/faraday-http-cache","description":"a faraday middleware that respects HTTP cache","fork":false,"url":"https://api.github.com/repos/plataformatec/faraday-http-cache","forks_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/forks","keys_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/teams","hooks_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/hooks","issue_events_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/issues/events{/number}","events_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/events","assignees_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/assignees{/user}","branches_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/branches{/branch}","tags_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/tags","blobs_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/statuses/{sha}","languages_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/languages","stargazers_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/stargazers","contributors_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/contributors","subscribers_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/subscribers","subscription_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/subscription","commits_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/issues/comments{/number}","contents_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/contents/{+path}","compare_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/merges","archive_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/downloads","issues_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/issues{/number}","pulls_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls{/number}","milestones_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/milestones{/number}","notifications_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/labels{/name}","releases_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/releases{/id}","deployments_url":"https://api.github.com/repos/plataformatec/faraday-http-cache/deployments","created_at":"2012-02-07T15:39:38Z","updated_at":"2016-08-12T13:01:37Z","pushed_at":"2016-08-11T18:43:13Z","git_url":"git://github.com/plataformatec/faraday-http-cache.git","ssh_url":"git@github.com:plataformatec/faraday-http-cache.git","clone_url":"https://github.com/plataformatec/faraday-http-cache.git","svn_url":"https://github.com/plataformatec/faraday-http-cache","homepage":"","size":385,"stargazers_count":193,"watchers_count":193,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":4,"forks":52,"open_issues":4,"watchers":193,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87"},"html":{"href":"https://github.com/plataformatec/faraday-http-cache/pull/87"},"issue":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/issues/87"},"comments":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/plataformatec/faraday-http-cache/statuses/8aa33a390f7ec8e5e8271f4888d43a8a9694a6d7"}}}}
{"actor":{"display_login":"lucasmazza"}}