fix: don't force server errors in legacy server (#517)
* fix: don't force server errors in legacy server * fix tests and be more consistent with the returned status code
This commit is contained in:
parent
844e2337bb
commit
57d04e7465
5 changed files with 42 additions and 22 deletions
|
@ -365,14 +365,14 @@ func Test_webServer_authorizeHandler(t *testing.T) {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "authorize error",
|
||||
name: "server error",
|
||||
fields: fields{
|
||||
server: &requestVerifier{},
|
||||
decoder: testDecoder,
|
||||
},
|
||||
r: httptest.NewRequest(http.MethodPost, "/authorize", strings.NewReader("foo=bar")),
|
||||
want: webServerResult{
|
||||
wantStatus: http.StatusBadRequest,
|
||||
wantStatus: http.StatusInternalServerError,
|
||||
wantBody: `{"error":"server_error"}`,
|
||||
},
|
||||
},
|
||||
|
@ -1237,7 +1237,7 @@ func Test_webServer_simpleHandler(t *testing.T) {
|
|||
},
|
||||
r: httptest.NewRequest(http.MethodGet, "/", bytes.NewReader(make([]byte, 11<<20))),
|
||||
want: webServerResult{
|
||||
wantStatus: http.StatusBadRequest,
|
||||
wantStatus: http.StatusInternalServerError,
|
||||
wantBody: `{"error":"server_error", "error_description":"io: read/write on closed pipe"}`,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue