improve the forbidden message

This commit is contained in:
deads2k
2016-12-13 09:17:46 -05:00
parent 9705bb728e
commit f6829bbde7
5 changed files with 37 additions and 15 deletions

View File

@@ -308,7 +308,8 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr
message = "the server has asked for the client to provide credentials"
case http.StatusForbidden:
reason = metav1.StatusReasonForbidden
message = "the server does not allow access to the requested resource"
// the server message has details about who is trying to perform what action. Keep its message.
message = serverMessage
case http.StatusMethodNotAllowed:
reason = metav1.StatusReasonMethodNotAllowed
message = "the server does not allow this method on the requested resource"