diff options
Diffstat (limited to 'src/io/request.nim')
-rw-r--r-- | src/io/request.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/io/request.nim b/src/io/request.nim index d61a19fa..72631bed 100644 --- a/src/io/request.nim +++ b/src/io/request.nim @@ -216,7 +216,8 @@ proc text*(response: Response): string {.jsfunc.} = result = response.body.readAll() response.body.close() response.bodyUsed = true - response.unregisterFun() + if response.unregisterFun != nil: + response.unregisterFun() #TODO: get rid of this proc readAll*(response: Response): string {.jsfunc.} = @@ -235,7 +236,8 @@ proc close*(response: Response) {.jsfunc.} = #TODO: this looks pretty unsafe response.body.close() response.bodyUsed = true - response.unregisterFun() + if response.unregisterFun != nil: + response.unregisterFun() func credentialsMode*(attribute: CORSAttribute): CredentialsMode = case attribute |