203203 */
204204package org .jooby .internal .netty ;
205205
206- import com .google .common .escape .Escapers ;
207- import static io .netty .channel .ChannelFutureListener .FIRE_EXCEPTION_ON_FAILURE ;
208-
209- import java .io .IOException ;
210- import java .io .InputStream ;
211- import java .net .InetSocketAddress ;
212- import java .net .URLDecoder ;
213- import java .util .Collections ;
214- import java .util .List ;
215- import java .util .Optional ;
216- import java .util .concurrent .Executor ;
217- import java .util .function .Function ;
218- import java .util .stream .Collectors ;
219-
220- import org .jooby .MediaType ;
221- import org .jooby .Router ;
222- import org .jooby .Sse ;
223- import org .jooby .spi .NativePushPromise ;
224- import org .jooby .spi .NativeRequest ;
225- import org .jooby .spi .NativeUpload ;
226- import org .jooby .spi .NativeWebSocket ;
227-
228206import com .google .common .collect .ArrayListMultimap ;
229207import com .google .common .collect .ImmutableList ;
230208import com .google .common .collect .Multimap ;
231-
232209import io .netty .buffer .ByteBuf ;
233210import io .netty .buffer .ByteBufHolder ;
234211import io .netty .buffer .ByteBufInputStream ;
235212import io .netty .channel .Channel ;
213+ import static io .netty .channel .ChannelFutureListener .FIRE_EXCEPTION_ON_FAILURE ;
236214import io .netty .channel .ChannelHandlerContext ;
237215import io .netty .handler .codec .http .FullHttpRequest ;
238216import io .netty .handler .codec .http .HttpContent ;
252230import io .netty .handler .codec .http2 .HttpConversionUtil ;
253231import io .netty .util .AttributeKey ;
254232import io .netty .util .ReferenceCounted ;
233+ import org .jooby .MediaType ;
234+ import org .jooby .Router ;
235+ import org .jooby .Sse ;
236+ import org .jooby .spi .NativePushPromise ;
237+ import org .jooby .spi .NativeRequest ;
238+ import org .jooby .spi .NativeUpload ;
239+ import org .jooby .spi .NativeWebSocket ;
240+
241+ import java .io .IOException ;
242+ import java .io .InputStream ;
243+ import java .net .InetSocketAddress ;
244+ import java .util .Collections ;
245+ import java .util .List ;
246+ import java .util .Optional ;
247+ import java .util .concurrent .Executor ;
248+ import java .util .function .Function ;
249+ import java .util .stream .Collectors ;
255250
256251public class NettyRequest implements NativeRequest {
257252
@@ -265,7 +260,8 @@ public class NettyRequest implements NativeRequest {
265260 .newInstance (NettyRequest .class .getName () + ".async" );
266261
267262 public static final AttributeKey <Boolean > SECURE = AttributeKey
268- .newInstance (NettyRequest .class .getName () + ".secure" );;
263+ .newInstance (NettyRequest .class .getName () + ".secure" );
264+ ;
269265
270266 private HttpRequest req ;
271267
@@ -292,7 +288,7 @@ public NettyRequest(final ChannelHandlerContext ctx,
292288 this .req = req ;
293289 this .tmpdir = tmpdir ;
294290 this .query = new QueryStringDecoder (req .uri ());
295- this .path = Router .decode (query .path ());
291+ this .path = Router .decode (query .path ());
296292 this .wsMaxMessageSize = wsMaxMessageSize ;
297293 Channel channel = ctx .channel ();
298294 channel .attr (ASYNC ).set (false );
@@ -480,15 +476,11 @@ private Multimap<String, String> decodeParams() throws IOException {
480476 };
481477 while (hasNext .apply (decoder )) {
482478 HttpData field = (HttpData ) decoder .next ();
483- try {
484- String name = field .getName ();
485- if (field .getHttpDataType () == HttpDataType .FileUpload ) {
486- files .put (name , new NettyUpload ((FileUpload ) field , tmpdir ));
487- } else {
488- params .put (name , field .getString ());
489- }
490- } finally {
491- field .release ();
479+ String name = field .getName ();
480+ if (field .getHttpDataType () == HttpDataType .FileUpload ) {
481+ files .put (name , new NettyUpload ((FileUpload ) field , tmpdir ));
482+ } else {
483+ params .put (name , field .getString ());
492484 }
493485 }
494486 } finally {
0 commit comments