|
[enhydra] Possible Bug in MultiPartMimeInputStream: msg#00013java.enhydra.general
Hi! I found something that i think is bug: in MultipartMimeInputStream when reading the headers of a multipart request, the byte are autamatically transformed in String instead of using the correct encoding. This happen in 5.4.1 and the last enhydra version from CVS (6.5.1?). The problem is the headers in multipart request have usefull information like the file name. Not using the correct encoding to transform the bytes to a String, made the file name appears wtih strange chars on it. For enhydra 5.4.1 a made a little patch: i just changed one line in the constructor and added the necessary import. I changed the line: String line = new String(bytesToChars(lineBuf,0,n)); to: String line = new String(lineBuf,0,n,HttpUtils.ENCODING); And added the: import javax.servlet.http.HttpUtils; Now it works well. :) For 6.5.1 i did not made a patch but it should be something similar like changing the same line to: String line = new String(lineBuf,0,n, comms.request.getHttpServletRequest().getCharacterEncoding()); and add the necessary imports. I attached the diff for 5.4.1. I hope this can be usefull. Best regards. João Paulo Ribeiro -- João Paulo Ribeiro | Senior Software Engineer jp@xxxxxxxxxxxx PHONE: + 351 253 305 250 FAX : + 351 253 305 250 www.mobicomp.com ________________________________________________________________ About Solutions | Wireless World CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender. DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content. 32d31 < import javax.servlet.http.HttpUtils; 142c141 < String line = new String(lineBuf,0,n,HttpUtils.ENCODING); --- > String line = new String(bytesToChars(lineBuf,0,n)); -- You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx mailing list. To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | AW: [enhydra] Re: [director] Using Enhydra Director as HTTP cookie based load-balancer, Madl Alfred - Together AT |
|---|---|
| Next by Date: | [enhydra] Why not bigint instead of numeric(19,0) in postgresql and using Long instead of BigDecimal, João Paulo Ribeiro |
| Previous by Thread: | AW: [enhydra] Re: [director] Using Enhydra Director as HTTP cookie based load-balancer, Madl Alfred - Together AT |
| Next by Thread: | Re: [enhydra] Possible Bug in MultiPartMimeInputStream, Slobodan Vujasinovic |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |