bykof / cordova-plugin-webserver

A webserver plugin for cordova
Other
119 stars 51 forks source link

Wait for response to be finished and return possible error #56

Open digaus opened 4 years ago

digaus commented 4 years ago

Currently once the response is send we do not know when it is finished.

Wouldnt it be possible to pass the callback into the responses array and then call the success callback once it is finished?

Just pass callback here:

https://github.com/bykof/cordova-plugin-webserver/blob/master/src/android/Webserver.java#L105

and call here:

https://github.com/bykof/cordova-plugin-webserver/blob/master/src/android/NanoHTTPDWebserver.java#L250 https://github.com/bykof/cordova-plugin-webserver/blob/master/src/android/NanoHTTPDWebserver.java#L271