mirror of
https://github.com/honojs/hono.git
synced 2024-11-22 11:17:33 +01:00
fix(HttpException): error message should not be the HTTP reason phrase (#1161)
* fix(HttpException): error message should not be the HTTP reason phrase * review fixes --------- Co-authored-by: Nasa <nasa@mail.inc>
This commit is contained in:
parent
39dcab0eb2
commit
8387b8c0f6
@ -19,7 +19,6 @@ export class HTTPException extends Error {
|
||||
}
|
||||
return new Response(this.message, {
|
||||
status: this.status,
|
||||
statusText: this.message,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -928,7 +928,6 @@ describe('Error handle', () => {
|
||||
it('Should return 401 response', async () => {
|
||||
const res = await app.request('http://localhost/exception')
|
||||
expect(res.status).toBe(401)
|
||||
expect(res.statusText).toBe('Unauthorized')
|
||||
expect(await res.text()).toBe('Unauthorized')
|
||||
})
|
||||
|
||||
|
@ -19,7 +19,6 @@ export class HTTPException extends Error {
|
||||
}
|
||||
return new Response(this.message, {
|
||||
status: this.status,
|
||||
statusText: this.message,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user