tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Bug in org.apache.tomcat.util.http.fileupload.MultipartStream.ItemInputStream#read(byte[], int, int)
Date Tue, 03 Jul 2018 18:07:53 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Piotr,

On 7/3/18 4:30 AM, Piotr JoĊ„ski wrote:
> Hi, thanks for reply! Here is sample snippet that i use to
> reproduce it: 
> ----------------------------------------------------------- 
> ----------------------------------------------------------- 
> #!/usr/bin/env bash echo; echo; echo; echo; echo; echo; curl
> 'http://localhost:8083/************' \ -H 'Origin: ***************'
> \ -H 'X-Client-Version: 6.5.2-rc0' \ -H 'Authorization:
> ********************' \ -H 'Content-Type:
> multipart/form-data;boundary="======boundary======"' \ -H 'Accept:
> application/json, text/plain, */*' \ -H 'Referer:
> *****************' \ -H 'X-Client-ID: *************' \ -H
> 'X-Request-Id: 16613F22FBF46FA9BA441125219C2B13' \ -H
> 'X-B3-TraceId: 16613f22fbf46fb9ba441125219c3b03' \ -H 'User-Agent:
> Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
> Gecko) Chrome/67.0.3396.99 Safari/537.36' \ -H 'DNT: 1' \ 
> --data-binary $'--======boundary======\nContent-disposition: 
> form-data; name="some-name"; filename="some-file"\r\nContent-Type: 
> application/http\r\nContent-ID: req0\r\n\r\nPUT /api/***** 
> HTTP/1.1\nContent-Type: 
> application/json\n\n{********json-here********}\r\n\r\n--======boundar
y======--'
>
> 
\
> --compressed echo; echo; echo; echo; echo; echo;

I think you need a trailing \r\n after that last boundary to close the
message. The BNF in the RFC doesn't seem to require the tailing CRLF,
but MIME is a very "line-oriented" protocol, so I wouldn't be
surprised if it needs a "complete line", which would include a
trailing CRLF.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAls7u3gACgkQHPApP6U8
pFhQiBAAg7BLjQQeWqcxc4OGoKAWrMYcvBXohEh7Mo9JLm1I1ky7u8Uj3wFoTzF1
5mdMQigGr+OOjhYbEzlT/HIr4jXarcznmcITY7f9e6DnmAol7hXXBHr8D7vUlR0w
T5szi6ejJ20yyyfwqg/s5wNOIJC06LDPEUHWpO/AG7+6yfZ61g8UZfxi5y259RmU
KVg3CdysBTDOrWlFoclnsXttD4JJG+Vr1B9RfrEXuQf0cko5u+ArSmXivmEUJ+RM
IhgY2dqJSC2cf+7PNV8n8kAqmoPWN8aoe7CWL7gsb4U1XHV1l0INAvzEXBeBCVSp
XLwX0/nEMXNG0DeKN5WQDCZE6D0d5a5Nt4NGZCmNuYXzDGf095FLjpPaAgKADJVL
7b8lFA8d7+58CMlKAeP5C6d/wNR2NMyF4COgwC1LcKiMGyLGRNGVsI7MnG91sGdO
jb2rVYkeQ7k/+KHk4PTzKZ1Osff9eXU29L3SDb9MuHYJUCp9fyVmlyHYdOZq5qxM
YcGb5IwaEdC1rwO3syZSan81nyJiqpG+QH8g7viTq1h9WByVBLrwwgIaWSzCXIQM
D/ibaI5PtMj4Gbq08pgJTZTzZuRxfgFOnmqmnQW3jFe6Y//BaEYoI6yYQZxdmIYE
a9dE7oqBLslAq/fNKjQCGm6ymZoqT+PlXgEzQ8KQQZlSLVw54MQ=
=6JFv
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message