Author: toad
Date: 2006-12-04 16:12:25 +0000 (Mon, 04 Dec 2006)
New Revision: 11222

Modified:
   trunk/freenet/src/freenet/clients/http/HTTPRequest.java
Log:
Filenames etc in multipart/form-data are in UTF-8 (because we asked the browser 
to send them in UTF-8).
Minor logging.

Modified: trunk/freenet/src/freenet/clients/http/HTTPRequest.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/HTTPRequest.java     2006-12-04 
15:21:18 UTC (rev 11221)
+++ trunk/freenet/src/freenet/clients/http/HTTPRequest.java     2006-12-04 
16:12:25 UTC (rev 11222)
@@ -483,7 +483,7 @@
                        filename = null;
                        contentType = null;
                        // chomp headers
-                       while( (line = lis.readLine(200, 200, false)) /* see 
above */ != null) {
+                       while( (line = lis.readLine(200, 200, true)) /* should 
be UTF-8 as we told the browser to send UTF-8 */ != null) {
                                if (line.length() == 0) break;

                                String[] lineparts = line.split(":");
@@ -550,6 +550,8 @@
                        bbos.close();

                        parts.put(name, filedata);
+                       if(Logger.shouldLog(Logger.MINOR, this))
+                               Logger.minor(this, "Name = "+name+" length = 
"+filedata.size()+" filename = "+filename);
                        if (filename != null) {
                                uploadedFiles.put(name, new File(filename, 
contentType, filedata));
                        }


Reply via email to