Open jivank opened 3 years ago
Currently asynchttpserver reads the entire body into memory which makes anything dependent on it unable to handle large file uploads.
asynchttpserver
Please see this issue for more info: https://github.com/nim-lang/Nim/issues/17331
There are two ways that this could be handled that come to mind:
Request
I think option 1 is probably the better choice to leave some flexibility to the framework. Also it seems to be inline with how Go handles this: https://golang.org/pkg/net/http/#Request.ParseMultipartForm
The only pro for option 2 I can think of is that the framework won't have to do it. But as I said it is possible in some use cases just deferring the reading the body to the framework might be more flexible to build upon.
I prefer (1) too, assuming it implies less code for asynchttpserver.
Option (1) would also match how httpclient does it.
Currently
asynchttpserver
reads the entire body into memory which makes anything dependent on it unable to handle large file uploads.Please see this issue for more info: https://github.com/nim-lang/Nim/issues/17331
There are two ways that this could be handled that come to mind:
asynchttpserver
and provide new fields toRequest
I think option 1 is probably the better choice to leave some flexibility to the framework. Also it seems to be inline with how Go handles this: https://golang.org/pkg/net/http/#Request.ParseMultipartForm
The only pro for option 2 I can think of is that the framework won't have to do it. But as I said it is possible in some use cases just deferring the reading the body to the framework might be more flexible to build upon.