Skip to content

Commit

Permalink
Merge pull request #20 from Comcast/status-forbidden
Browse files Browse the repository at this point in the history
Changed StatusUnauthorized to StatusForbidden
  • Loading branch information
schmidtw authored Apr 25, 2019
2 parents 1463096 + 11f1922 commit 17c1172
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bascule/basculehttp/constructor.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *constructor) decorate(next http.Handler) http.Handler {
if err != nil {
logger.Log(level.Key(), level.ErrorValue(), bascule.ErrorKey, err.Error(), "key", key,
"auth", authorization[i+1:])
WriteResponse(response, http.StatusUnauthorized, err)
WriteResponse(response, http.StatusForbidden, err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion bascule/basculehttp/constructor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestConstructor(t *testing.T) {
constructor: c,
requestHeaderKey: testHeader,
requestHeaderValue: "Basic AFJDK",
expectedStatusCode: http.StatusUnauthorized,
expectedStatusCode: http.StatusForbidden,
},
}
for _, tc := range tests {
Expand Down
2 changes: 1 addition & 1 deletion bascule/basculehttp/enforcer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (e *enforcer) decorate(next http.Handler) http.Handler {
}
}
logger.Log(append(emperror.Context(err), level.Key(), level.ErrorValue(), bascule.ErrorKey, errs)...)
WriteResponse(response, http.StatusUnauthorized, err)
WriteResponse(response, http.StatusForbidden, err)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion bascule/basculehttp/enforcer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestEnforcer(t *testing.T) {
Authorization: "jwt",
Token: bascule.NewToken("", "", bascule.Attributes{}),
},
expectedStatusCode: http.StatusUnauthorized,
expectedStatusCode: http.StatusForbidden,
},
}
for _, tc := range tests {
Expand Down

0 comments on commit 17c1172

Please sign in to comment.