{"action":"created","comment":{"url":"https://api.github.com/repos/envato/fake_aws/pulls/comments/22996257","id":22996257,"diff_hunk":"@@ -56,24 +40,16 @@ def has_key?\n \n     private\n \n-      def server_name\n-        @server_name ||= @env[\"SERVER_NAME\"]\n-      end\n-\n-      def path_info\n-        @path_info ||= @env[\"PATH_INFO\"]\n-      end\n-\n       def server_name_components\n-        @server_name_components ||= server_name.split(\".\")\n+        @server_name_components ||= host.split(\".\")\n       end\n \n       def path_components\n-        @path_components ||= path_info.split(\"/\").drop(1)\n+        @path_components ||= path.split(\"/\").drop(1)\n       end\n \n       def request_style\n-        @request_style ||= if server_name =~ %r{s3[-\\w\\d]*\\.amazonaws\\.com$}\n+        @request_style ||= if host =~ %r{s3[-\\w\\d]*}","path":"lib/fake_aws/s3/request.rb","position":58,"original_position":58,"commit_id":"ecac268845027e1710395e7eb3e219e7a19ec04f","original_commit_id":"ecac268845027e1710395e7eb3e219e7a19ec04f","user":{"login":"armanm","id":1578748,"avatar_url":"https://avatars.githubusercontent.com/u/1578748?v=3","gravatar_id":"","url":"https://api.github.com/users/armanm","html_url":"https://github.com/armanm","followers_url":"https://api.github.com/users/armanm/followers","following_url":"https://api.github.com/users/armanm/following{/other_user}","gists_url":"https://api.github.com/users/armanm/gists{/gist_id}","starred_url":"https://api.github.com/users/armanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armanm/subscriptions","organizations_url":"https://api.github.com/users/armanm/orgs","repos_url":"https://api.github.com/users/armanm/repos","events_url":"https://api.github.com/users/armanm/events{/privacy}","received_events_url":"https://api.github.com/users/armanm/received_events","type":"User","site_admin":false},"body":"This change ensure a fake url for the rack app can be used to correctly identify the request style.","created_at":"2015-01-15T08:40:55Z","updated_at":"2015-01-15T08:40:55Z","html_url":"https://github.com/envato/fake_aws/pull/7#discussion_r22996257","pull_request_url":"https://api.github.com/repos/envato/fake_aws/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/envato/fake_aws/pulls/comments/22996257"},"html":{"href":"https://github.com/envato/fake_aws/pull/7#discussion_r22996257"},"pull_request":{"href":"https://api.github.com/repos/envato/fake_aws/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/envato/fake_aws/pulls/7","id":27412920,"html_url":"https://github.com/envato/fake_aws/pull/7","diff_url":"https://github.com/envato/fake_aws/pull/7.diff","patch_url":"https://github.com/envato/fake_aws/pull/7.patch","issue_url":"https://api.github.com/repos/envato/fake_aws/issues/7","number":7,"state":"open","locked":false,"title":"User Rack::Request for consistency between different Rack web servers","user":{"login":"armanm","id":1578748,"avatar_url":"https://avatars.githubusercontent.com/u/1578748?v=3","gravatar_id":"","url":"https://api.github.com/users/armanm","html_url":"https://github.com/armanm","followers_url":"https://api.github.com/users/armanm/followers","following_url":"https://api.github.com/users/armanm/following{/other_user}","gists_url":"https://api.github.com/users/armanm/gists{/gist_id}","starred_url":"https://api.github.com/users/armanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armanm/subscriptions","organizations_url":"https://api.github.com/users/armanm/orgs","repos_url":"https://api.github.com/users/armanm/repos","events_url":"https://api.github.com/users/armanm/events{/privacy}","received_events_url":"https://api.github.com/users/armanm/received_events","type":"User","site_admin":false},"body":"Using this gem with Unicorn was failing for me because the `FakeAws::S3::Request` class had trouble figuring out key names from the request.\r\n\r\nAfter looking further into it I realised there are discrepancies between the environments passed in by different rack servers (i.e Faraday passes in `PATH_INFO` while Unicorn passes `REQUEST_PATH`).\r\n\r\nI inspect how Rails gets around this problem and it looks like the simplest solution is to make `FakeAws::S3::Request` inherit from `Rack::Request` in order to resolve these differences. With that in place I simply fixed broken specs and got the branch to go green.","created_at":"2015-01-15T08:36:59Z","updated_at":"2015-01-15T08:40:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d32f30df52e3b33faaed6eaa7d6edb4836df2e1e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/envato/fake_aws/pulls/7/commits","review_comments_url":"https://api.github.com/repos/envato/fake_aws/pulls/7/comments","review_comment_url":"https://api.github.com/repos/envato/fake_aws/pulls/comments/{number}","comments_url":"https://api.github.com/repos/envato/fake_aws/issues/7/comments","statuses_url":"https://api.github.com/repos/envato/fake_aws/statuses/ecac268845027e1710395e7eb3e219e7a19ec04f","head":{"label":"envato:with-rack-changes","ref":"with-rack-changes","sha":"ecac268845027e1710395e7eb3e219e7a19ec04f","user":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":14128692,"name":"fake_aws","full_name":"envato/fake_aws","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/fake_aws","description":"","fork":false,"url":"https://api.github.com/repos/envato/fake_aws","forks_url":"https://api.github.com/repos/envato/fake_aws/forks","keys_url":"https://api.github.com/repos/envato/fake_aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/fake_aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/fake_aws/teams","hooks_url":"https://api.github.com/repos/envato/fake_aws/hooks","issue_events_url":"https://api.github.com/repos/envato/fake_aws/issues/events{/number}","events_url":"https://api.github.com/repos/envato/fake_aws/events","assignees_url":"https://api.github.com/repos/envato/fake_aws/assignees{/user}","branches_url":"https://api.github.com/repos/envato/fake_aws/branches{/branch}","tags_url":"https://api.github.com/repos/envato/fake_aws/tags","blobs_url":"https://api.github.com/repos/envato/fake_aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/fake_aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/fake_aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/fake_aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/fake_aws/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/fake_aws/languages","stargazers_url":"https://api.github.com/repos/envato/fake_aws/stargazers","contributors_url":"https://api.github.com/repos/envato/fake_aws/contributors","subscribers_url":"https://api.github.com/repos/envato/fake_aws/subscribers","subscription_url":"https://api.github.com/repos/envato/fake_aws/subscription","commits_url":"https://api.github.com/repos/envato/fake_aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/fake_aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/fake_aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/fake_aws/issues/comments/{number}","contents_url":"https://api.github.com/repos/envato/fake_aws/contents/{+path}","compare_url":"https://api.github.com/repos/envato/fake_aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/fake_aws/merges","archive_url":"https://api.github.com/repos/envato/fake_aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/fake_aws/downloads","issues_url":"https://api.github.com/repos/envato/fake_aws/issues{/number}","pulls_url":"https://api.github.com/repos/envato/fake_aws/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/fake_aws/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/fake_aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/fake_aws/labels{/name}","releases_url":"https://api.github.com/repos/envato/fake_aws/releases{/id}","created_at":"2013-11-05T01:20:43Z","updated_at":"2014-08-16T13:37:49Z","pushed_at":"2015-01-15T08:39:26Z","git_url":"git://github.com/envato/fake_aws.git","ssh_url":"git@github.com:envato/fake_aws.git","clone_url":"https://github.com/envato/fake_aws.git","svn_url":"https://github.com/envato/fake_aws","homepage":null,"size":359,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"envato:master","ref":"master","sha":"f532bdbb05b54b2cb4b527660cb6962319831f36","user":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":14128692,"name":"fake_aws","full_name":"envato/fake_aws","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/fake_aws","description":"","fork":false,"url":"https://api.github.com/repos/envato/fake_aws","forks_url":"https://api.github.com/repos/envato/fake_aws/forks","keys_url":"https://api.github.com/repos/envato/fake_aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/fake_aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/fake_aws/teams","hooks_url":"https://api.github.com/repos/envato/fake_aws/hooks","issue_events_url":"https://api.github.com/repos/envato/fake_aws/issues/events{/number}","events_url":"https://api.github.com/repos/envato/fake_aws/events","assignees_url":"https://api.github.com/repos/envato/fake_aws/assignees{/user}","branches_url":"https://api.github.com/repos/envato/fake_aws/branches{/branch}","tags_url":"https://api.github.com/repos/envato/fake_aws/tags","blobs_url":"https://api.github.com/repos/envato/fake_aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/fake_aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/fake_aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/fake_aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/fake_aws/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/fake_aws/languages","stargazers_url":"https://api.github.com/repos/envato/fake_aws/stargazers","contributors_url":"https://api.github.com/repos/envato/fake_aws/contributors","subscribers_url":"https://api.github.com/repos/envato/fake_aws/subscribers","subscription_url":"https://api.github.com/repos/envato/fake_aws/subscription","commits_url":"https://api.github.com/repos/envato/fake_aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/fake_aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/fake_aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/fake_aws/issues/comments/{number}","contents_url":"https://api.github.com/repos/envato/fake_aws/contents/{+path}","compare_url":"https://api.github.com/repos/envato/fake_aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/fake_aws/merges","archive_url":"https://api.github.com/repos/envato/fake_aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/fake_aws/downloads","issues_url":"https://api.github.com/repos/envato/fake_aws/issues{/number}","pulls_url":"https://api.github.com/repos/envato/fake_aws/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/fake_aws/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/fake_aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/fake_aws/labels{/name}","releases_url":"https://api.github.com/repos/envato/fake_aws/releases{/id}","created_at":"2013-11-05T01:20:43Z","updated_at":"2014-08-16T13:37:49Z","pushed_at":"2015-01-15T08:39:26Z","git_url":"git://github.com/envato/fake_aws.git","ssh_url":"git@github.com:envato/fake_aws.git","clone_url":"https://github.com/envato/fake_aws.git","svn_url":"https://github.com/envato/fake_aws","homepage":null,"size":359,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/envato/fake_aws/pulls/7"},"html":{"href":"https://github.com/envato/fake_aws/pull/7"},"issue":{"href":"https://api.github.com/repos/envato/fake_aws/issues/7"},"comments":{"href":"https://api.github.com/repos/envato/fake_aws/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/envato/fake_aws/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/envato/fake_aws/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/envato/fake_aws/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/envato/fake_aws/statuses/ecac268845027e1710395e7eb3e219e7a19ec04f"}}}}