{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/comments/127581735","pull_request_review_id":50186874,"id":127581735,"diff_hunk":"@@ -251,35 +260,33 @@ protected[core] object WhiskWebActionsApi extends Directives {\n         }\n     }\n \n-    private def interpretHttpResponse(code: StatusCode, headers: List[RawHeader], str: String, transid: TransactionId): RequestContext => Unit = {\n+    private def interpretHttpResponse(code: StatusCode, headers: List[RawHeader], str: String, transid: TransactionId) = {\n         val parsedHeader: Try[MediaType] = headers.find(_.lowercaseName == `Content-Type`.lowercaseName) match {\n             case Some(header) =>\n-                HttpParser.parseHeader(header) match {\n-                    case Right(header: `Content-Type`) =>\n-                        val mediaType = header.contentType.mediaType\n+                MediaType.parse(header.value) match {\n+                    case Right(mediaType: MediaType) =>\n                         // lookup the media type specified in the content header to see if it is a recognized type\n                         MediaTypes.getForKey(mediaType.mainType -> mediaType.subType).map(Success(_)).getOrElse {\n                             // this is a content-type that is not recognized, reject it\n                             Failure(RejectRequest(BadRequest, Messages.httpUnknownContentType)(transid))\n                         }\n-\n-                    case _ =>\n-                        Failure(RejectRequest(BadRequest, Messages.httpUnknownContentType)(transid))\n-                }\n+                    case _ => Failure(RejectRequest(BadRequest, Messages.httpUnknownContentType)(transid))\n+            }\n             case None => Success(`text/html`)\n         }\n \n         parsedHeader.flatMap { mediaType =>\n-            if (mediaType.binary) {\n-                Try(HttpData(Base64.getDecoder().decode(str))).map((mediaType, _))\n+            if (mediaType.binary || mediaType == `application/json`) {\n+                Try(new String(Base64.getDecoder().decode(str), \"UTF-8\")).map((mediaType, _))\n             } else {\n-                Success(mediaType, HttpData(str))\n+                Success(mediaType, str)\n             }\n         } match {\n-            case Success((mediaType, data)) =>\n+            case Success((mediaType, data: String)) =>\n                 respondWithHeaders(headers) {\n-                    respondWithMediaType(mediaType) {\n-                        complete(code, data)\n+                    mediaType.toString.split(\"/\") match {\n+                        case Array(mainType, subType) =>\n+                            complete(code, HttpEntity(ContentType(MediaType.customWithFixedCharset(mainType, subType, HttpCharsets.`UTF-8`)), data))","path":"core/controller/src/main/scala/whisk/core/controller/WebActions.scala","position":181,"original_position":181,"commit_id":"580d332a4373ee0050873a192e312bac0a3a5e8b","original_commit_id":"580d332a4373ee0050873a192e312bac0a3a5e8b","user":{"login":"markusthoemmes","id":1289147,"avatar_url":"https://avatars7.githubusercontent.com/u/1289147?v=4","gravatar_id":"","url":"https://api.github.com/users/markusthoemmes","html_url":"https://github.com/markusthoemmes","followers_url":"https://api.github.com/users/markusthoemmes/followers","following_url":"https://api.github.com/users/markusthoemmes/following{/other_user}","gists_url":"https://api.github.com/users/markusthoemmes/gists{/gist_id}","starred_url":"https://api.github.com/users/markusthoemmes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markusthoemmes/subscriptions","organizations_url":"https://api.github.com/users/markusthoemmes/orgs","repos_url":"https://api.github.com/users/markusthoemmes/repos","events_url":"https://api.github.com/users/markusthoemmes/events{/privacy}","received_events_url":"https://api.github.com/users/markusthoemmes/received_events","type":"User","site_admin":false},"body":"I'm a bit uneasy with the changes to this method.\r\n\r\nDo we need to manually split Strings here vs. parsing the data out using akka methods?","created_at":"2017-07-15T10:46:33Z","updated_at":"2017-07-15T10:46:33Z","html_url":"https://github.com/apache/incubator-openwhisk/pull/2218#discussion_r127581735","pull_request_url":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/comments/127581735"},"html":{"href":"https://github.com/apache/incubator-openwhisk/pull/2218#discussion_r127581735"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218","id":119239740,"html_url":"https://github.com/apache/incubator-openwhisk/pull/2218","diff_url":"https://github.com/apache/incubator-openwhisk/pull/2218.diff","patch_url":"https://github.com/apache/incubator-openwhisk/pull/2218.patch","issue_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2218","number":2218,"state":"open","locked":false,"title":"Port Controller from Spray to Akka","user":{"login":"dubeejw","id":11520887,"avatar_url":"https://avatars7.githubusercontent.com/u/11520887?v=4","gravatar_id":"","url":"https://api.github.com/users/dubeejw","html_url":"https://github.com/dubeejw","followers_url":"https://api.github.com/users/dubeejw/followers","following_url":"https://api.github.com/users/dubeejw/following{/other_user}","gists_url":"https://api.github.com/users/dubeejw/gists{/gist_id}","starred_url":"https://api.github.com/users/dubeejw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dubeejw/subscriptions","organizations_url":"https://api.github.com/users/dubeejw/orgs","repos_url":"https://api.github.com/users/dubeejw/repos","events_url":"https://api.github.com/users/dubeejw/events{/privacy}","received_events_url":"https://api.github.com/users/dubeejw/received_events","type":"User","site_admin":false},"body":"- Refactor controller to use Akka as Spray is no longer supported","created_at":"2017-05-05T19:08:15Z","updated_at":"2017-07-15T10:46:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62defbe71f9938e714d670749a8af4160866b3be","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rabbah","id":4959922,"avatar_url":"https://avatars7.githubusercontent.com/u/4959922?v=4","gravatar_id":"","url":"https://api.github.com/users/rabbah","html_url":"https://github.com/rabbah","followers_url":"https://api.github.com/users/rabbah/followers","following_url":"https://api.github.com/users/rabbah/following{/other_user}","gists_url":"https://api.github.com/users/rabbah/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbah/subscriptions","organizations_url":"https://api.github.com/users/rabbah/orgs","repos_url":"https://api.github.com/users/rabbah/repos","events_url":"https://api.github.com/users/rabbah/events{/privacy}","received_events_url":"https://api.github.com/users/rabbah/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2218/comments","statuses_url":"https://api.github.com/repos/apache/incubator-openwhisk/statuses/580d332a4373ee0050873a192e312bac0a3a5e8b","head":{"label":"dubeejw:v2","ref":"v2","sha":"580d332a4373ee0050873a192e312bac0a3a5e8b","user":{"login":"dubeejw","id":11520887,"avatar_url":"https://avatars7.githubusercontent.com/u/11520887?v=4","gravatar_id":"","url":"https://api.github.com/users/dubeejw","html_url":"https://github.com/dubeejw","followers_url":"https://api.github.com/users/dubeejw/followers","following_url":"https://api.github.com/users/dubeejw/following{/other_user}","gists_url":"https://api.github.com/users/dubeejw/gists{/gist_id}","starred_url":"https://api.github.com/users/dubeejw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dubeejw/subscriptions","organizations_url":"https://api.github.com/users/dubeejw/orgs","repos_url":"https://api.github.com/users/dubeejw/repos","events_url":"https://api.github.com/users/dubeejw/events{/privacy}","received_events_url":"https://api.github.com/users/dubeejw/received_events","type":"User","site_admin":false},"repo":{"id":56244037,"name":"openwhisk","full_name":"dubeejw/openwhisk","owner":{"login":"dubeejw","id":11520887,"avatar_url":"https://avatars7.githubusercontent.com/u/11520887?v=4","gravatar_id":"","url":"https://api.github.com/users/dubeejw","html_url":"https://github.com/dubeejw","followers_url":"https://api.github.com/users/dubeejw/followers","following_url":"https://api.github.com/users/dubeejw/following{/other_user}","gists_url":"https://api.github.com/users/dubeejw/gists{/gist_id}","starred_url":"https://api.github.com/users/dubeejw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dubeejw/subscriptions","organizations_url":"https://api.github.com/users/dubeejw/orgs","repos_url":"https://api.github.com/users/dubeejw/repos","events_url":"https://api.github.com/users/dubeejw/events{/privacy}","received_events_url":"https://api.github.com/users/dubeejw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dubeejw/openwhisk","description":"OpenWhisk is a cloud-first distributed event-based programming service.","fork":true,"url":"https://api.github.com/repos/dubeejw/openwhisk","forks_url":"https://api.github.com/repos/dubeejw/openwhisk/forks","keys_url":"https://api.github.com/repos/dubeejw/openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dubeejw/openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dubeejw/openwhisk/teams","hooks_url":"https://api.github.com/repos/dubeejw/openwhisk/hooks","issue_events_url":"https://api.github.com/repos/dubeejw/openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/dubeejw/openwhisk/events","assignees_url":"https://api.github.com/repos/dubeejw/openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/dubeejw/openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/dubeejw/openwhisk/tags","blobs_url":"https://api.github.com/repos/dubeejw/openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dubeejw/openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dubeejw/openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/dubeejw/openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dubeejw/openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/dubeejw/openwhisk/languages","stargazers_url":"https://api.github.com/repos/dubeejw/openwhisk/stargazers","contributors_url":"https://api.github.com/repos/dubeejw/openwhisk/contributors","subscribers_url":"https://api.github.com/repos/dubeejw/openwhisk/subscribers","subscription_url":"https://api.github.com/repos/dubeejw/openwhisk/subscription","commits_url":"https://api.github.com/repos/dubeejw/openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/dubeejw/openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/dubeejw/openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/dubeejw/openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/dubeejw/openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/dubeejw/openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dubeejw/openwhisk/merges","archive_url":"https://api.github.com/repos/dubeejw/openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dubeejw/openwhisk/downloads","issues_url":"https://api.github.com/repos/dubeejw/openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/dubeejw/openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/dubeejw/openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/dubeejw/openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dubeejw/openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/dubeejw/openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/dubeejw/openwhisk/deployments","created_at":"2016-04-14T14:26:32Z","updated_at":"2016-04-14T14:26:34Z","pushed_at":"2017-07-15T03:30:22Z","git_url":"git://github.com/dubeejw/openwhisk.git","ssh_url":"git@github.com:dubeejw/openwhisk.git","clone_url":"https://github.com/dubeejw/openwhisk.git","svn_url":"https://github.com/dubeejw/openwhisk","homepage":"","size":56514,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"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":"apache:master","ref":"master","sha":"c64103574d8c66d8f228ff9b605f459f26bd2e3e","user":{"login":"apache","id":47359,"avatar_url":"https://avatars4.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":52039373,"name":"incubator-openwhisk","full_name":"apache/incubator-openwhisk","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars4.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-openwhisk","description":"Apache OpenWhisk is a serverless event-based programming service and an Apache Incubator project.","fork":false,"url":"https://api.github.com/repos/apache/incubator-openwhisk","forks_url":"https://api.github.com/repos/apache/incubator-openwhisk/forks","keys_url":"https://api.github.com/repos/apache/incubator-openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-openwhisk/teams","hooks_url":"https://api.github.com/repos/apache/incubator-openwhisk/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-openwhisk/events","assignees_url":"https://api.github.com/repos/apache/incubator-openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-openwhisk/tags","blobs_url":"https://api.github.com/repos/apache/incubator-openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-openwhisk/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-openwhisk/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-openwhisk/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-openwhisk/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-openwhisk/subscription","commits_url":"https://api.github.com/repos/apache/incubator-openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-openwhisk/merges","archive_url":"https://api.github.com/repos/apache/incubator-openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-openwhisk/downloads","issues_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-openwhisk/deployments","created_at":"2016-02-18T21:16:19Z","updated_at":"2017-07-15T06:54:10Z","pushed_at":"2017-07-15T06:04:44Z","git_url":"git://github.com/apache/incubator-openwhisk.git","ssh_url":"git@github.com:apache/incubator-openwhisk.git","clone_url":"https://github.com/apache/incubator-openwhisk.git","svn_url":"https://github.com/apache/incubator-openwhisk","homepage":"http://openwhisk.org","size":55820,"stargazers_count":1691,"watchers_count":1691,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":370,"mirror_url":null,"open_issues_count":358,"forks":370,"open_issues":358,"watchers":1691,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218"},"html":{"href":"https://github.com/apache/incubator-openwhisk/pull/2218"},"issue":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2218"},"comments":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2218/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/pulls/2218/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-openwhisk/statuses/580d332a4373ee0050873a192e312bac0a3a5e8b"}}}}
{"actor":{"display_login":"markusthoemmes"}}