Github user attilapiros commented on a diff in the pull request:
https://github.com/apache/spark/pull/21644#discussion_r198185350
--- Diff:
core/src/main/scala/org/apache/spark/status/api/v1/ApiRootResource.scala ---
@@ -148,38 +148,36 @@ private[v1] trait BaseAppResource extends
ApiRequestContext {
}
private[v1] class ForbiddenException(msg: String) extends
WebApplicationException(
- Response.status(Response.Status.FORBIDDEN).entity(msg).build())
+
Response.status(Response.Status.FORBIDDEN).entity(msg).`type`(MediaType.TEXT_PLAIN).build())
--- End diff --
You can extract a new helper function to build the response object from a
`Response.Status` and a message. I think UIUtils is good place for such a
function then you can use it at `OneApplicationResource.scala` too as the
`serverError`method just sets the status to `Status.INTERNAL_SERVER_ERROR`
which overwritten by right away with `Response.Status.SERVICE_UNAVAILABLE`.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]