You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below program which I though would just accept all body bits and never send a response crashes with an unhelpful message (promise leak in HTTPServerHandler).
import Vapor
varenv=tryEnvironment.detect()tryLoggingSystem.bootstrap(from:&env)letapp=Application(env)defer{ app.shutdown()}
app.on(.POST,"echo"){ request ->ResponseinreturnResponse(body:.init(stream:{ writer in
request.body.drain{ body inreturn request.eventLoop.makeSucceededFuture(())}}, count:0))}try app.run()
I guess it's totally fair to crash if the user never completes the writer but a message telling the user what they need to do would be good I think.
The text was updated successfully, but these errors were encountered:
Below program which I though would just accept all body bits and never send a response crashes with an unhelpful message (promise leak in
HTTPServerHandler
).I guess it's totally fair to crash if the user never completes the
writer
but a message telling the user what they need to do would be good I think.The text was updated successfully, but these errors were encountered: