mirror of
https://forgejo.merr.is/annika/jwtauth.git
synced 2025-12-11 13:47:41 -05:00
remove unnecessary code. (#69)
This commit is contained in:
parent
6047f9231e
commit
137d669fb7
2 changed files with 7 additions and 11 deletions
|
|
@ -153,12 +153,12 @@ func TestMore(t *testing.T) {
|
|||
token, _, err := jwtauth.FromContext(r.Context())
|
||||
|
||||
if err != nil {
|
||||
http.Error(w, jwtauth.ErrorReason(err).Error(), 401)
|
||||
http.Error(w, jwtauth.ErrorReason(err).Error(), http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
if err := jwt.Validate(token); err != nil {
|
||||
http.Error(w, jwtauth.ErrorReason(err).Error(), 401)
|
||||
http.Error(w, jwtauth.ErrorReason(err).Error(), http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -242,10 +242,8 @@ func testRequest(t *testing.T, ts *httptest.Server, method, path string, header
|
|||
return 0, ""
|
||||
}
|
||||
|
||||
if header != nil {
|
||||
for k, v := range header {
|
||||
req.Header.Set(k, v[0])
|
||||
}
|
||||
for k, v := range header {
|
||||
req.Header.Set(k, v[0])
|
||||
}
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue