{"action":"created","comment":{"url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/comments/99735377","pull_request_review_id":20420385,"id":99735377,"diff_hunk":"@@ -0,0 +1,120 @@\n+#include \"gtest/gtest.h\"\n+#include \"http_handler_file.h\"\n+#include \"http_request.h\"\n+#include \"http_response.h\"\n+\n+\n+\n+\n+class HttpHandlerFileTest : public ::testing::Test {\n+protected:\n+    void form_request(std::string path) {\n+        r.path = path;        \n+    }\n+    \n+    http::request r;\n+   \n+\n+};\n+\n+TEST_F(HttpHandlerFileTest, FileExists) {\n+\n+\tint fd;\n+    char name[] = \"/tmp/fileXXXXXX\";\n+\n+\n+    std::string text_contents = \"foo bar\\n bar foo\";\n+\n+    // Creates a temporary file using name, replacing the last 6 X's \n+    fd = mkstemp(name);\n+\n+    // Write the config_contents into the temp file\n+    write(fd, text_contents.c_str(), text_contents.size());\n+\n+    form_request(\"/static1\" + std::string(name));\n+    http::handler_file hf(\"/\", \"/static1\");\n+\n+\n+    http::response res = hf.handle_request(r);\n+\n+\n+    //Delete the file\n+    remove(name);\n+\n+\n+    EXPECT_EQ(\"Content-Length\", res.headers[0].name);\n+    EXPECT_EQ(std::to_string(text_contents.size()), res.headers[0].value);\n+    EXPECT_EQ(\"Content-Type\", res.headers[1].name);\n+\tEXPECT_EQ(\"text/plain\", res.headers[1].value);","path":"http_handler_file_test.cc","position":48,"original_position":48,"commit_id":"bf19cb8ab546c59a4aca1eea775a3ef7ffa8c4a3","original_commit_id":"bf19cb8ab546c59a4aca1eea775a3ef7ffa8c4a3","user":{"login":"alfredlucero","id":11841941,"avatar_url":"https://avatars.githubusercontent.com/u/11841941?v=3","gravatar_id":"","url":"https://api.github.com/users/alfredlucero","html_url":"https://github.com/alfredlucero","followers_url":"https://api.github.com/users/alfredlucero/followers","following_url":"https://api.github.com/users/alfredlucero/following{/other_user}","gists_url":"https://api.github.com/users/alfredlucero/gists{/gist_id}","starred_url":"https://api.github.com/users/alfredlucero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfredlucero/subscriptions","organizations_url":"https://api.github.com/users/alfredlucero/orgs","repos_url":"https://api.github.com/users/alfredlucero/repos","events_url":"https://api.github.com/users/alfredlucero/events{/privacy}","received_events_url":"https://api.github.com/users/alfredlucero/received_events","type":"User","site_admin":false},"body":"Indentations pls.","created_at":"2017-02-07T02:52:09Z","updated_at":"2017-02-07T02:52:10Z","html_url":"https://github.com/UCLA-CS130/Team05/pull/25#discussion_r99735377","pull_request_url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/comments/99735377"},"html":{"href":"https://github.com/UCLA-CS130/Team05/pull/25#discussion_r99735377"},"pull_request":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25","id":104925817,"html_url":"https://github.com/UCLA-CS130/Team05/pull/25","diff_url":"https://github.com/UCLA-CS130/Team05/pull/25.diff","patch_url":"https://github.com/UCLA-CS130/Team05/pull/25.patch","issue_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues/25","number":25,"state":"open","locked":false,"title":"Request handlers test","user":{"login":"gotitmemorize","id":5722026,"avatar_url":"https://avatars.githubusercontent.com/u/5722026?v=3","gravatar_id":"","url":"https://api.github.com/users/gotitmemorize","html_url":"https://github.com/gotitmemorize","followers_url":"https://api.github.com/users/gotitmemorize/followers","following_url":"https://api.github.com/users/gotitmemorize/following{/other_user}","gists_url":"https://api.github.com/users/gotitmemorize/gists{/gist_id}","starred_url":"https://api.github.com/users/gotitmemorize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gotitmemorize/subscriptions","organizations_url":"https://api.github.com/users/gotitmemorize/orgs","repos_url":"https://api.github.com/users/gotitmemorize/repos","events_url":"https://api.github.com/users/gotitmemorize/events{/privacy}","received_events_url":"https://api.github.com/users/gotitmemorize/received_events","type":"User","site_admin":false},"body":"Added tests for http_handler_file and http_handler_echo","created_at":"2017-02-07T02:38:10Z","updated_at":"2017-02-07T02:52:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49c0b1ff85d2fd93068eda50cd2fd1855d437d7f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25/commits","review_comments_url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25/comments","review_comment_url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues/25/comments","statuses_url":"https://api.github.com/repos/UCLA-CS130/Team05/statuses/bf19cb8ab546c59a4aca1eea775a3ef7ffa8c4a3","head":{"label":"UCLA-CS130:request_handlers_test","ref":"request_handlers_test","sha":"bf19cb8ab546c59a4aca1eea775a3ef7ffa8c4a3","user":{"login":"UCLA-CS130","id":23248621,"avatar_url":"https://avatars.githubusercontent.com/u/23248621?v=3","gravatar_id":"","url":"https://api.github.com/users/UCLA-CS130","html_url":"https://github.com/UCLA-CS130","followers_url":"https://api.github.com/users/UCLA-CS130/followers","following_url":"https://api.github.com/users/UCLA-CS130/following{/other_user}","gists_url":"https://api.github.com/users/UCLA-CS130/gists{/gist_id}","starred_url":"https://api.github.com/users/UCLA-CS130/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UCLA-CS130/subscriptions","organizations_url":"https://api.github.com/users/UCLA-CS130/orgs","repos_url":"https://api.github.com/users/UCLA-CS130/repos","events_url":"https://api.github.com/users/UCLA-CS130/events{/privacy}","received_events_url":"https://api.github.com/users/UCLA-CS130/received_events","type":"Organization","site_admin":false},"repo":{"id":79513344,"name":"Team05","full_name":"UCLA-CS130/Team05","owner":{"login":"UCLA-CS130","id":23248621,"avatar_url":"https://avatars.githubusercontent.com/u/23248621?v=3","gravatar_id":"","url":"https://api.github.com/users/UCLA-CS130","html_url":"https://github.com/UCLA-CS130","followers_url":"https://api.github.com/users/UCLA-CS130/followers","following_url":"https://api.github.com/users/UCLA-CS130/following{/other_user}","gists_url":"https://api.github.com/users/UCLA-CS130/gists{/gist_id}","starred_url":"https://api.github.com/users/UCLA-CS130/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UCLA-CS130/subscriptions","organizations_url":"https://api.github.com/users/UCLA-CS130/orgs","repos_url":"https://api.github.com/users/UCLA-CS130/repos","events_url":"https://api.github.com/users/UCLA-CS130/events{/privacy}","received_events_url":"https://api.github.com/users/UCLA-CS130/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UCLA-CS130/Team05","description":null,"fork":false,"url":"https://api.github.com/repos/UCLA-CS130/Team05","forks_url":"https://api.github.com/repos/UCLA-CS130/Team05/forks","keys_url":"https://api.github.com/repos/UCLA-CS130/Team05/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UCLA-CS130/Team05/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UCLA-CS130/Team05/teams","hooks_url":"https://api.github.com/repos/UCLA-CS130/Team05/hooks","issue_events_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues/events{/number}","events_url":"https://api.github.com/repos/UCLA-CS130/Team05/events","assignees_url":"https://api.github.com/repos/UCLA-CS130/Team05/assignees{/user}","branches_url":"https://api.github.com/repos/UCLA-CS130/Team05/branches{/branch}","tags_url":"https://api.github.com/repos/UCLA-CS130/Team05/tags","blobs_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/refs{/sha}","trees_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UCLA-CS130/Team05/statuses/{sha}","languages_url":"https://api.github.com/repos/UCLA-CS130/Team05/languages","stargazers_url":"https://api.github.com/repos/UCLA-CS130/Team05/stargazers","contributors_url":"https://api.github.com/repos/UCLA-CS130/Team05/contributors","subscribers_url":"https://api.github.com/repos/UCLA-CS130/Team05/subscribers","subscription_url":"https://api.github.com/repos/UCLA-CS130/Team05/subscription","commits_url":"https://api.github.com/repos/UCLA-CS130/Team05/commits{/sha}","git_commits_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/commits{/sha}","comments_url":"https://api.github.com/repos/UCLA-CS130/Team05/comments{/number}","issue_comment_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues/comments{/number}","contents_url":"https://api.github.com/repos/UCLA-CS130/Team05/contents/{+path}","compare_url":"https://api.github.com/repos/UCLA-CS130/Team05/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UCLA-CS130/Team05/merges","archive_url":"https://api.github.com/repos/UCLA-CS130/Team05/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UCLA-CS130/Team05/downloads","issues_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues{/number}","pulls_url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls{/number}","milestones_url":"https://api.github.com/repos/UCLA-CS130/Team05/milestones{/number}","notifications_url":"https://api.github.com/repos/UCLA-CS130/Team05/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UCLA-CS130/Team05/labels{/name}","releases_url":"https://api.github.com/repos/UCLA-CS130/Team05/releases{/id}","deployments_url":"https://api.github.com/repos/UCLA-CS130/Team05/deployments","created_at":"2017-01-20T01:33:57Z","updated_at":"2017-01-31T16:30:56Z","pushed_at":"2017-02-07T02:38:10Z","git_url":"git://github.com/UCLA-CS130/Team05.git","ssh_url":"git@github.com:UCLA-CS130/Team05.git","clone_url":"https://github.com/UCLA-CS130/Team05.git","svn_url":"https://github.com/UCLA-CS130/Team05","homepage":null,"size":1409,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"UCLA-CS130:master","ref":"master","sha":"c7fae6c8690e67fc6aafefdf63387fad1e1fb707","user":{"login":"UCLA-CS130","id":23248621,"avatar_url":"https://avatars.githubusercontent.com/u/23248621?v=3","gravatar_id":"","url":"https://api.github.com/users/UCLA-CS130","html_url":"https://github.com/UCLA-CS130","followers_url":"https://api.github.com/users/UCLA-CS130/followers","following_url":"https://api.github.com/users/UCLA-CS130/following{/other_user}","gists_url":"https://api.github.com/users/UCLA-CS130/gists{/gist_id}","starred_url":"https://api.github.com/users/UCLA-CS130/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UCLA-CS130/subscriptions","organizations_url":"https://api.github.com/users/UCLA-CS130/orgs","repos_url":"https://api.github.com/users/UCLA-CS130/repos","events_url":"https://api.github.com/users/UCLA-CS130/events{/privacy}","received_events_url":"https://api.github.com/users/UCLA-CS130/received_events","type":"Organization","site_admin":false},"repo":{"id":79513344,"name":"Team05","full_name":"UCLA-CS130/Team05","owner":{"login":"UCLA-CS130","id":23248621,"avatar_url":"https://avatars.githubusercontent.com/u/23248621?v=3","gravatar_id":"","url":"https://api.github.com/users/UCLA-CS130","html_url":"https://github.com/UCLA-CS130","followers_url":"https://api.github.com/users/UCLA-CS130/followers","following_url":"https://api.github.com/users/UCLA-CS130/following{/other_user}","gists_url":"https://api.github.com/users/UCLA-CS130/gists{/gist_id}","starred_url":"https://api.github.com/users/UCLA-CS130/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UCLA-CS130/subscriptions","organizations_url":"https://api.github.com/users/UCLA-CS130/orgs","repos_url":"https://api.github.com/users/UCLA-CS130/repos","events_url":"https://api.github.com/users/UCLA-CS130/events{/privacy}","received_events_url":"https://api.github.com/users/UCLA-CS130/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UCLA-CS130/Team05","description":null,"fork":false,"url":"https://api.github.com/repos/UCLA-CS130/Team05","forks_url":"https://api.github.com/repos/UCLA-CS130/Team05/forks","keys_url":"https://api.github.com/repos/UCLA-CS130/Team05/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UCLA-CS130/Team05/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UCLA-CS130/Team05/teams","hooks_url":"https://api.github.com/repos/UCLA-CS130/Team05/hooks","issue_events_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues/events{/number}","events_url":"https://api.github.com/repos/UCLA-CS130/Team05/events","assignees_url":"https://api.github.com/repos/UCLA-CS130/Team05/assignees{/user}","branches_url":"https://api.github.com/repos/UCLA-CS130/Team05/branches{/branch}","tags_url":"https://api.github.com/repos/UCLA-CS130/Team05/tags","blobs_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/refs{/sha}","trees_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UCLA-CS130/Team05/statuses/{sha}","languages_url":"https://api.github.com/repos/UCLA-CS130/Team05/languages","stargazers_url":"https://api.github.com/repos/UCLA-CS130/Team05/stargazers","contributors_url":"https://api.github.com/repos/UCLA-CS130/Team05/contributors","subscribers_url":"https://api.github.com/repos/UCLA-CS130/Team05/subscribers","subscription_url":"https://api.github.com/repos/UCLA-CS130/Team05/subscription","commits_url":"https://api.github.com/repos/UCLA-CS130/Team05/commits{/sha}","git_commits_url":"https://api.github.com/repos/UCLA-CS130/Team05/git/commits{/sha}","comments_url":"https://api.github.com/repos/UCLA-CS130/Team05/comments{/number}","issue_comment_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues/comments{/number}","contents_url":"https://api.github.com/repos/UCLA-CS130/Team05/contents/{+path}","compare_url":"https://api.github.com/repos/UCLA-CS130/Team05/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UCLA-CS130/Team05/merges","archive_url":"https://api.github.com/repos/UCLA-CS130/Team05/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UCLA-CS130/Team05/downloads","issues_url":"https://api.github.com/repos/UCLA-CS130/Team05/issues{/number}","pulls_url":"https://api.github.com/repos/UCLA-CS130/Team05/pulls{/number}","milestones_url":"https://api.github.com/repos/UCLA-CS130/Team05/milestones{/number}","notifications_url":"https://api.github.com/repos/UCLA-CS130/Team05/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UCLA-CS130/Team05/labels{/name}","releases_url":"https://api.github.com/repos/UCLA-CS130/Team05/releases{/id}","deployments_url":"https://api.github.com/repos/UCLA-CS130/Team05/deployments","created_at":"2017-01-20T01:33:57Z","updated_at":"2017-01-31T16:30:56Z","pushed_at":"2017-02-07T02:38:10Z","git_url":"git://github.com/UCLA-CS130/Team05.git","ssh_url":"git@github.com:UCLA-CS130/Team05.git","clone_url":"https://github.com/UCLA-CS130/Team05.git","svn_url":"https://github.com/UCLA-CS130/Team05","homepage":null,"size":1409,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25"},"html":{"href":"https://github.com/UCLA-CS130/Team05/pull/25"},"issue":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/issues/25"},"comments":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/UCLA-CS130/Team05/statuses/bf19cb8ab546c59a4aca1eea775a3ef7ffa8c4a3"}}}}
{"actor":{"display_login":"alfredlucero"}}