@@ -44,9 +44,9 @@ func Forbidden(attributes authorizer.Attributes, w http.ResponseWriter, req *htt
44
44
w .WriteHeader (http .StatusForbidden )
45
45
46
46
if len (reason ) == 0 {
47
- fmt .Fprintf (w , "%s" , msg )
47
+ fmt .Fprintf (w , "%s. " , msg )
48
48
} else {
49
- fmt .Fprintf (w , "%s: %q " , msg , reason )
49
+ fmt .Fprintf (w , "%s: %s " , msg , reason )
50
50
}
51
51
}
52
52
@@ -57,7 +57,7 @@ func forbiddenMessage(attributes authorizer.Attributes) string {
57
57
}
58
58
59
59
if ! attributes .IsResourceRequest () {
60
- return fmt .Sprintf ("User %q cannot %s path %q. " , username , attributes .GetVerb (), attributes .GetPath ())
60
+ return fmt .Sprintf ("User %q cannot %s path %q" , username , attributes .GetVerb (), attributes .GetPath ())
61
61
}
62
62
63
63
resource := attributes .GetResource ()
@@ -69,10 +69,10 @@ func forbiddenMessage(attributes authorizer.Attributes) string {
69
69
}
70
70
71
71
if ns := attributes .GetNamespace (); len (ns ) > 0 {
72
- return fmt .Sprintf ("User %q cannot %s %s in the namespace %q. " , username , attributes .GetVerb (), resource , ns )
72
+ return fmt .Sprintf ("User %q cannot %s %s in the namespace %q" , username , attributes .GetVerb (), resource , ns )
73
73
}
74
74
75
- return fmt .Sprintf ("User %q cannot %s %s at the cluster scope. " , username , attributes .GetVerb (), resource )
75
+ return fmt .Sprintf ("User %q cannot %s %s at the cluster scope" , username , attributes .GetVerb (), resource )
76
76
}
77
77
78
78
// InternalError renders a simple internal error
0 commit comments