0
0
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:
Alexander Kozlov 2023-06-07 15:17:52 +03:00 committed by GitHub
parent 39dcab0eb2
commit 8387b8c0f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 3 deletions

View File

@ -19,7 +19,6 @@ export class HTTPException extends Error {
}
return new Response(this.message, {
status: this.status,
statusText: this.message,
})
}
}

View File

@ -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')
})

View File

@ -19,7 +19,6 @@ export class HTTPException extends Error {
}
return new Response(this.message, {
status: this.status,
statusText: this.message,
})
}
}