mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-10 15:47:36 +02:00
internal/httputil: use error structs for http errors (#159)
The existing implementation used a ErrorResponse method to propogate and create http error messages. Since we added functionality to troubleshoot, signout, and do other tasks following an http error it's useful to use Error struct in place of method arguments. This fixes #157 where a troubleshooting links were appearing on pages that it didn't make sense on (e.g. pages without valid sessions).
This commit is contained in:
parent
14403ce388
commit
bade9f50e6
9 changed files with 244 additions and 133 deletions
|
@ -175,8 +175,8 @@ func TestValidateClientSecret(t *testing.T) {
|
|||
}{
|
||||
{"simple", "secret", "secret", "secret", http.StatusOK},
|
||||
{"missing get param, valid header", "secret", "", "secret", http.StatusOK},
|
||||
{"missing both", "secret", "", "", http.StatusUnauthorized},
|
||||
{"simple bad", "bad-secret", "secret", "", http.StatusUnauthorized},
|
||||
{"missing both", "secret", "", "", http.StatusInternalServerError},
|
||||
{"simple bad", "bad-secret", "secret", "", http.StatusInternalServerError},
|
||||
{"malformed, invalid hex digits", "secret", "%zzzzz", "", http.StatusBadRequest},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue