Error response enhancements, CoreID auth client backend

This commit is contained in:
2022-03-29 01:14:46 -05:00
parent a039b1ff25
commit 8f08b94f74
31 changed files with 736 additions and 52 deletions

View File

@@ -195,6 +195,10 @@ export class Response {
*/
public async write(data: string | Buffer | Uint8Array | Readable): Promise<void> {
return new Promise<void>((res, rej) => {
if ( this.responseEnded ) {
throw new ErrorWithContext('Tried to write to Response after lifecycle ended.')
}
if ( !this.sentHeaders ) {
this.sendHeaders()
}