netty - how to write response when it is not the lastchunk -
i running netty http upload example , have 1 additional requirement authentication before upload files; understand upload big files using multipart mode upload, , server side read post request multiple times.
so idea set token in request body first parameter, , when reading chunks can firstly verify token ,if not match cancel whole request , return status code client side.
the point how can cancel request , send status code appropriately, had tried below, when channel have closed, client did not finished sending request, , throw "connection reset" exception:
channelfuture future = channel.writeandflush(response); future.addlistener(channelfuturelistener.close);
how send response client during manually reading chunked post msg. in case send response , close channel when chunk not last chunk ,client side not response.
i think way you're doing correct, note that, according following item found on answering before full request received possible not supported of browsers:
is acceptable server send http response before entire request has been received?
if client own, have log shows message coming before connection reset? have ability send answer server @ first message, before chunk (so based on headers only) (it might perhaps) ?
Comments
Post a Comment