-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[3.5.5.Final] Error when uploading nothing #569
Copy link
Copy link
Closed
Description
I'm using Netty 3.5.5.Final and Firefox 14.0.1.
When uploading a form like this:
<form class="well span6" method="post" action="/apps/573d3849f224f9f1a160b6feb2759967/markers/7ab50bf507ac9bd3cf08f2141b4e2158" enctype="multipart/form-data">
<input type="hidden" name="csrf-token" value="9d26ddeb-3b38-4a49-924e-9f3093f37cf7"/>
<input type="hidden" name="_method" value="put"/>
<label>Image</label>
<input class="span6" type="file" name="image"/>
<label>Description</label>
<input class="span6" type="text" name="description" value="" />
<label>Return data</label>
<input class="span6" type="text" name="return_data" value="" />
</form>
I sometimes (not always, about once every 5 times) get this error when not selecting any image file to upload:
java.lang.IndexOutOfBoundsException: null
at org.jboss.netty.buffer.AbstractChannelBuffer.readerIndex(AbstractChannelBuffer.java:44) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostBodyUtil$SeekAheadOptimize.setReadPosition(HttpPostBodyUtil.java:163) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.skipControlCharacters(HttpPostRequestDecoder.java:865) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.findMultipartDelimiter(HttpPostRequestDecoder.java:895) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.decodeMultipart(HttpPostRequestDecoder.java:766) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.parseBodyMultipart(HttpPostRequestDecoder.java:727) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.parseBody(HttpPostRequestDecoder.java:408) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.<init>(HttpPostRequestDecoder.java:191) ~[netty-3.5.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.<init>(HttpPostRequestDecoder.java:148) ~[netty-3.5.5.Final.jar:na]
at xitrum.handler.up.BodyParser.messageReceived(BodyParser.scala:55) ~[xitrum_2.9.2-1.9.4.jar:1.9.4]
BodyParser.scala:55
https://github.com/ngocdaothanh/xitrum/blob/master/src/main/scala/xitrum/handler/up/BodyParser.scala#L55
Data sent to server:
POST /apps/573d3849f224f9f1a160b6feb2759967/markers/7ab50bf507ac9bd3cf08f2141b4e2158 HTTP/1.1
Host: localhost:2218
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20100101 Firefox/14.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost:2218/apps/573d3849f224f9f1a160b6feb2759967/markers/7ab50bf507ac9bd3cf08f2141b4e2158/edit
Cookie: _session=AAACQJAneGp2k3ib2OyAbItsVTmeqtcheBHiZx1aF2gXN4uoCBxlD8zMkKzlvEXKyQy8acAQGNBU6hfNt9XD5yywFmgZ72ZyFSHlYWVe7ha2xAhbNKI-5uxq7F0eLxVt-ks9_SJfPx1LAmMyY9SV42DOr9t8jl3UCbSJmKYFwi_JWMEvDNmruoUyaKBYMDwNbMnE2BZmsbWQ3IJt9AjrO3EVIwdFFF-LUpKP_0AWhtAOcgDek1Xm627eg9qHSNyWHRzz-mb3ZaR3EjfNXqq-dxfRt89bglfn4xHI8pK9TrFXHhbctQJLUeFdK3GVPYv1zqshGdYPGjv2S1d6D36sunYZujl5lHQ0tnSwdEcU2KzEs04jNkXPGPqjVsQLdOUlWvIXcrOVEXrIV3cqctpNW0ofZR24Z4mEhjo2X5O7zN4FeYGBF371BzkSuexa6Ix3mIrNu4pO5aUidMAufyAwqUl44hUr0rgMjfSEaj9THWavvVwctw6GiATeqQnE7xZNw8VIA8dbMLnJhZ2Czumwzh0YumQK_qTeVKEuFRHUdoDgU5jXuuj7vn9BAJ2eSDebUvZs7M_cI159TLb4c_hfclbMVXD8WVXlVkbGL_0NxYHvwtCYYPYZPtS90-s7oZQ4xSgH0ewK-EmUl7et25e7pphsr13PV_OyLcxccU9UNseiIy8HGL0OM5c8dWCjTW45eHeDv0ZcK_NtQLEHjUxmik6izC2rpelzSyUPl7IRocLTn1HoW79oz2H3fTdhee2MwWdgR9Z2BZhOgNA6erb-lPrNZruy97sS7QdiGZGs-7DUlmdX
Content-Type: multipart/form-data; boundary=---------------------------10903988221855041503514953775
Content-Length: 831
-----------------------------10903988221855041503514953775
Content-Disposition: form-data; name="csrf-token"
9d26ddeb-3b38-4a49-924e-9f3093f37cf7
-----------------------------10903988221855041503514953775
Content-Disposition: form-data; name="_method"
put
-----------------------------10903988221855041503514953775
Content-Disposition: form-data; name="image"; filename=""
Content-Type: application/octet-stream
-----------------------------10903988221855041503514953775
Content-Disposition: form-data; name="description"
-----------------------------10903988221855041503514953775
Content-Disposition: form-data; name="return_data"
http://169.254.47.225:2218/upload/file/f12a4df1da77a5c66ac8adaf42d3f28d/5ead9425a4571037e007c35186e452fb.mp4
-----------------------------10903988221855041503514953775--
Reactions are currently unavailable