{"action":"created","comment":{"url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/comments/181545337","pull_request_review_id":112200869,"id":181545337,"diff_hunk":"@@ -97,37 +97,76 @@ Content-Type: application/json; charset=UTF-8\n Content-ID: <f17ff476-0960-443d-9805-3f5d398a3c5d#TextClient:1.0/2018/03/10/09/e59eab82b4da42b684ea5ed33b1955a7/04:05::TNIH_2V.f7f5577a-9b52-41d4-a273-c0796379590fZXV_1490666545>\n Content-Type: application/octet-stream\n \n-second-part-of-multi-part-message\n+first-part-of-multi-part-message\n --------abcde123--`;\n \n   exports.caption_key_doesnt_exist_in_avs_directive = {\n     rawData: rawData\n   };\n }\n \n-// A multi-part message with three parts. Each of the parts is valid.\n-// Important to test this because usually multi-part messages from AVS have two parts but sometimes more.\n+// A multi-part message with multiple parts where one part is a valid text response from Alexa and others are either valid non-text responses or parts whose Content-Type is not known.\n {\n+  const validTextResponseContentType = \"application/json; charset=UTF-8\";\n+  const validNonTextResponseContentType = \"application/octet-stream\";\n+  const emptyContentType = \"\";\n+  let missingContentType;\n+\n   const alexaResponse = \"alexa success response\";\n   const rawData = String.raw`--------abcde123\n-Content-Type: application/json; charset=UTF-8\n+Content-Type: ${validTextResponseContentType}\n \n {\"directive\":{\"header\":{\"namespace\":\"SpeechSynthesizer\",\"name\":\"Speak\",\"messageId\":\"67ba4c5a-211e-4722-a53d-44c9728f5377\"},\"payload\":{\"caption\":\"${alexaResponse}\",\"url\":\"cid:f17ff476-0960-443d-9805-3f5d398a3c5d#TextClient:1.0/2018/03/10/09/e59eab82b4da42b684ea5ed33b1955a7/04:05::TNIH_2V.f7f5577a-9b52-41d4-a273-c0796379590fZXV_1490666545\",\"format\":\"AUDIO_MPEG\",\"token\":\"amzn1.as-ct.v1.Domain:Application:Knowledge#ACRI#f17ff476-0960-443d-9805-3f5d398a3c5d#TextClient:1.0/2018/03/10/09/e59eab82b4da42b684ea5ed33b1955a7/04:05::TNIH_2V.f7f5577a-9b52-41d4-a273-c0796379590fZXV\",\"ssml\":\"<speak><prosody volume=\\\"x-loud\\\"><p xmlns:amazon=\\\"https://amazon.com/ssml/2017-01-01/\\\" xmlns:ivona=\\\"http://www.ivona.com/2009/12/ssml\\\">${alexaResponse}</p></prosody><metadata><promptMetadata><promptId>AnswerSsml</promptId><namespace>SmartDJ.MusicQA</namespace><locale>en_US</locale><overrideId>default</overrideId><variant>809dfcd2-2807-4eaf-93e9-1130c2db01fa</variant><condition/><weight>1</weight><stageVersion>Adm-20141203_202706-183</stageVersion></promptMetadata></metadata></speak>\"}}}\n --------abcde123\n Content-ID: <f17ff476-0960-443d-9805-3f5d398a3c5d#TextClient:1.0/2018/03/10/09/e59eab82b4da42b684ea5ed33b1955a7/04:05::TNIH_2V.f7f5577a-9b52-41d4-a273-c0796379590fZXV_1490666545>\n-Content-Type: application/octet-stream\n+Content-Type: ${validNonTextResponseContentType}\n+\n+first-part-of-multi-part-message","path":"src/test-data/multipart-response-test-data.js","position":33,"original_position":33,"commit_id":"d130150b6243547229f834017e142f3e063f0122","original_commit_id":"d130150b6243547229f834017e142f3e063f0122","user":{"login":"s-maheshbabu","id":10920089,"avatar_url":"https://avatars3.githubusercontent.com/u/10920089?v=4","gravatar_id":"","url":"https://api.github.com/users/s-maheshbabu","html_url":"https://github.com/s-maheshbabu","followers_url":"https://api.github.com/users/s-maheshbabu/followers","following_url":"https://api.github.com/users/s-maheshbabu/following{/other_user}","gists_url":"https://api.github.com/users/s-maheshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/s-maheshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-maheshbabu/subscriptions","organizations_url":"https://api.github.com/users/s-maheshbabu/orgs","repos_url":"https://api.github.com/users/s-maheshbabu/repos","events_url":"https://api.github.com/users/s-maheshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/s-maheshbabu/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2018-04-14T08:01:41Z","updated_at":"2018-04-14T08:01:41Z","html_url":"https://github.com/s-maheshbabu/silent-alexa/pull/41#discussion_r181545337","pull_request_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/comments/181545337"},"html":{"href":"https://github.com/s-maheshbabu/silent-alexa/pull/41#discussion_r181545337"},"pull_request":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41"}},"in_reply_to_id":181540684},"pull_request":{"url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41","id":181380809,"html_url":"https://github.com/s-maheshbabu/silent-alexa/pull/41","diff_url":"https://github.com/s-maheshbabu/silent-alexa/pull/41.diff","patch_url":"https://github.com/s-maheshbabu/silent-alexa/pull/41.patch","issue_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/41","number":41,"state":"open","locked":false,"title":"Parse out all parts from Alexa's response.","user":{"login":"s-maheshbabu","id":10920089,"avatar_url":"https://avatars3.githubusercontent.com/u/10920089?v=4","gravatar_id":"","url":"https://api.github.com/users/s-maheshbabu","html_url":"https://github.com/s-maheshbabu","followers_url":"https://api.github.com/users/s-maheshbabu/followers","following_url":"https://api.github.com/users/s-maheshbabu/following{/other_user}","gists_url":"https://api.github.com/users/s-maheshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/s-maheshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-maheshbabu/subscriptions","organizations_url":"https://api.github.com/users/s-maheshbabu/orgs","repos_url":"https://api.github.com/users/s-maheshbabu/repos","events_url":"https://api.github.com/users/s-maheshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/s-maheshbabu/received_events","type":"User","site_admin":false},"body":"Fix for https://github.com/s-maheshbabu/silent-alexa/issues/22\r\n\r\nIn this commit, we parse out all text parts (defined by\r\nContentType === application/json; charset=UTF-8).","created_at":"2018-04-13T04:00:53Z","updated_at":"2018-04-14T08:01:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e69c7544db155d44e198e643d6b323b7fd25f16e","assignee":{"login":"gootla-manasa","id":5608915,"avatar_url":"https://avatars1.githubusercontent.com/u/5608915?v=4","gravatar_id":"","url":"https://api.github.com/users/gootla-manasa","html_url":"https://github.com/gootla-manasa","followers_url":"https://api.github.com/users/gootla-manasa/followers","following_url":"https://api.github.com/users/gootla-manasa/following{/other_user}","gists_url":"https://api.github.com/users/gootla-manasa/gists{/gist_id}","starred_url":"https://api.github.com/users/gootla-manasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gootla-manasa/subscriptions","organizations_url":"https://api.github.com/users/gootla-manasa/orgs","repos_url":"https://api.github.com/users/gootla-manasa/repos","events_url":"https://api.github.com/users/gootla-manasa/events{/privacy}","received_events_url":"https://api.github.com/users/gootla-manasa/received_events","type":"User","site_admin":false},"assignees":[{"login":"gootla-manasa","id":5608915,"avatar_url":"https://avatars1.githubusercontent.com/u/5608915?v=4","gravatar_id":"","url":"https://api.github.com/users/gootla-manasa","html_url":"https://github.com/gootla-manasa","followers_url":"https://api.github.com/users/gootla-manasa/followers","following_url":"https://api.github.com/users/gootla-manasa/following{/other_user}","gists_url":"https://api.github.com/users/gootla-manasa/gists{/gist_id}","starred_url":"https://api.github.com/users/gootla-manasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gootla-manasa/subscriptions","organizations_url":"https://api.github.com/users/gootla-manasa/orgs","repos_url":"https://api.github.com/users/gootla-manasa/repos","events_url":"https://api.github.com/users/gootla-manasa/events{/privacy}","received_events_url":"https://api.github.com/users/gootla-manasa/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41/commits","review_comments_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41/comments","review_comment_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/41/comments","statuses_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/statuses/d130150b6243547229f834017e142f3e063f0122","head":{"label":"s-maheshbabu:multiple_responses","ref":"multiple_responses","sha":"d130150b6243547229f834017e142f3e063f0122","user":{"login":"s-maheshbabu","id":10920089,"avatar_url":"https://avatars3.githubusercontent.com/u/10920089?v=4","gravatar_id":"","url":"https://api.github.com/users/s-maheshbabu","html_url":"https://github.com/s-maheshbabu","followers_url":"https://api.github.com/users/s-maheshbabu/followers","following_url":"https://api.github.com/users/s-maheshbabu/following{/other_user}","gists_url":"https://api.github.com/users/s-maheshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/s-maheshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-maheshbabu/subscriptions","organizations_url":"https://api.github.com/users/s-maheshbabu/orgs","repos_url":"https://api.github.com/users/s-maheshbabu/repos","events_url":"https://api.github.com/users/s-maheshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/s-maheshbabu/received_events","type":"User","site_admin":false},"repo":{"id":122009781,"name":"silent-alexa","full_name":"s-maheshbabu/silent-alexa","owner":{"login":"s-maheshbabu","id":10920089,"avatar_url":"https://avatars3.githubusercontent.com/u/10920089?v=4","gravatar_id":"","url":"https://api.github.com/users/s-maheshbabu","html_url":"https://github.com/s-maheshbabu","followers_url":"https://api.github.com/users/s-maheshbabu/followers","following_url":"https://api.github.com/users/s-maheshbabu/following{/other_user}","gists_url":"https://api.github.com/users/s-maheshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/s-maheshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-maheshbabu/subscriptions","organizations_url":"https://api.github.com/users/s-maheshbabu/orgs","repos_url":"https://api.github.com/users/s-maheshbabu/repos","events_url":"https://api.github.com/users/s-maheshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/s-maheshbabu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s-maheshbabu/silent-alexa","description":"A text based interface to Amazon Alexa","fork":false,"url":"https://api.github.com/repos/s-maheshbabu/silent-alexa","forks_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/forks","keys_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/teams","hooks_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/hooks","issue_events_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/events{/number}","events_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/events","assignees_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/assignees{/user}","branches_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/branches{/branch}","tags_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/tags","blobs_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/refs{/sha}","trees_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/statuses/{sha}","languages_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/languages","stargazers_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/stargazers","contributors_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/contributors","subscribers_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/subscribers","subscription_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/subscription","commits_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/commits{/sha}","git_commits_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/commits{/sha}","comments_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/comments{/number}","issue_comment_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/comments{/number}","contents_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/contents/{+path}","compare_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/merges","archive_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/downloads","issues_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues{/number}","pulls_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls{/number}","milestones_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/milestones{/number}","notifications_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/labels{/name}","releases_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/releases{/id}","deployments_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/deployments","created_at":"2018-02-19T02:09:22Z","updated_at":"2018-04-12T14:56:24Z","pushed_at":"2018-04-13T17:49:27Z","git_url":"git://github.com/s-maheshbabu/silent-alexa.git","ssh_url":"git@github.com:s-maheshbabu/silent-alexa.git","clone_url":"https://github.com/s-maheshbabu/silent-alexa.git","svn_url":"https://github.com/s-maheshbabu/silent-alexa","homepage":null,"size":3834,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":1,"open_issues":11,"watchers":1,"default_branch":"master"}},"base":{"label":"s-maheshbabu:return_array_of_text_responses","ref":"return_array_of_text_responses","sha":"976499654bffd8c91cbe99af513f049bc5276f50","user":{"login":"s-maheshbabu","id":10920089,"avatar_url":"https://avatars3.githubusercontent.com/u/10920089?v=4","gravatar_id":"","url":"https://api.github.com/users/s-maheshbabu","html_url":"https://github.com/s-maheshbabu","followers_url":"https://api.github.com/users/s-maheshbabu/followers","following_url":"https://api.github.com/users/s-maheshbabu/following{/other_user}","gists_url":"https://api.github.com/users/s-maheshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/s-maheshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-maheshbabu/subscriptions","organizations_url":"https://api.github.com/users/s-maheshbabu/orgs","repos_url":"https://api.github.com/users/s-maheshbabu/repos","events_url":"https://api.github.com/users/s-maheshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/s-maheshbabu/received_events","type":"User","site_admin":false},"repo":{"id":122009781,"name":"silent-alexa","full_name":"s-maheshbabu/silent-alexa","owner":{"login":"s-maheshbabu","id":10920089,"avatar_url":"https://avatars3.githubusercontent.com/u/10920089?v=4","gravatar_id":"","url":"https://api.github.com/users/s-maheshbabu","html_url":"https://github.com/s-maheshbabu","followers_url":"https://api.github.com/users/s-maheshbabu/followers","following_url":"https://api.github.com/users/s-maheshbabu/following{/other_user}","gists_url":"https://api.github.com/users/s-maheshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/s-maheshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-maheshbabu/subscriptions","organizations_url":"https://api.github.com/users/s-maheshbabu/orgs","repos_url":"https://api.github.com/users/s-maheshbabu/repos","events_url":"https://api.github.com/users/s-maheshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/s-maheshbabu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s-maheshbabu/silent-alexa","description":"A text based interface to Amazon Alexa","fork":false,"url":"https://api.github.com/repos/s-maheshbabu/silent-alexa","forks_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/forks","keys_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/teams","hooks_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/hooks","issue_events_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/events{/number}","events_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/events","assignees_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/assignees{/user}","branches_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/branches{/branch}","tags_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/tags","blobs_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/refs{/sha}","trees_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/statuses/{sha}","languages_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/languages","stargazers_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/stargazers","contributors_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/contributors","subscribers_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/subscribers","subscription_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/subscription","commits_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/commits{/sha}","git_commits_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/git/commits{/sha}","comments_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/comments{/number}","issue_comment_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/comments{/number}","contents_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/contents/{+path}","compare_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/merges","archive_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/downloads","issues_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues{/number}","pulls_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls{/number}","milestones_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/milestones{/number}","notifications_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/labels{/name}","releases_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/releases{/id}","deployments_url":"https://api.github.com/repos/s-maheshbabu/silent-alexa/deployments","created_at":"2018-02-19T02:09:22Z","updated_at":"2018-04-12T14:56:24Z","pushed_at":"2018-04-13T17:49:27Z","git_url":"git://github.com/s-maheshbabu/silent-alexa.git","ssh_url":"git@github.com:s-maheshbabu/silent-alexa.git","clone_url":"https://github.com/s-maheshbabu/silent-alexa.git","svn_url":"https://github.com/s-maheshbabu/silent-alexa","homepage":null,"size":3834,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":1,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41"},"html":{"href":"https://github.com/s-maheshbabu/silent-alexa/pull/41"},"issue":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/41"},"comments":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/s-maheshbabu/silent-alexa/statuses/d130150b6243547229f834017e142f3e063f0122"}},"author_association":"OWNER"}}
{"actor":{"display_login":"s-maheshbabu"}}