Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2552

By Multipart FormData read from tempfile bug with non-english characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.3.11.Final
    • Core
    • None
    • Hide

      Post a large value on a mutipart form with a lot of non-english characters

      Some extra characters changed on the server side.

      Show
      Post a large value on a mutipart form with a lot of non-english characters Some extra characters changed on the server side.
    • User Experience
    • Hide

      Perhaps if you increase the treshold size.

      Show
      Perhaps if you increase the treshold size.

      If multipart form data contains non English character and placed on 1024-1025's byte than undertow cut this character into two part and recognize theese as two character.

      Bug is after this pull request:

      UNDERTOW-2337 Multipart form-data larger than 16KiB is not available through Servlet getParameter API.

       

      This function handle just ascii string's well:

       

      public static String readFile(InputStream file, Charset charSet) {

      try (BufferedInputStream stream = new BufferedInputStream(file)) {

      byte[] buff = new byte[1024];

      StringBuilder builder = new StringBuilder();

      int read;

      while ((read = stream.read(buff)) != -1) {

      builder.append(new String(buff, 0, read, charSet));

      }

      return builder.toString();

      } catch (IOException e) {

      throw new RuntimeException(e);

      }

      }

       

              rhn-cservice-bbaranow Bartosz Baranowski
              hali19790320 Tóth László (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: