Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4432

Server error if the message in an AU request was too large

XMLWordPrintable

    • None

      Steps to Reproduce

      1. http://zkfiddle.org/sample/3e4hgq1/1-Another-new-ZK-fiddle
      2. click the button

      Current Result

      500: Form too large
      or
      400: Unable to parse form content

      (It depends on server implementations)

      Expected Result

      No error

      Debug Information

      https://stackoverflow.com/questions/3861455/form-too-large-exception

      Workaround

      Add system property to server

      Jetty:
      -Dorg.eclipse.jetty.server.Request.maxFormContentSize=5000000
      -Dorg.eclipse.jetty.server.Request.maxFormKeys=10000

      Or apply this patch:

      var oldAu = {};
          zk.override(zAu, oldAu, {
              sendNow: function (dt) {
                  zk.log('=============== fix Keikai 54');
                  // KEIKAI-54
                  if (!zk.mounting && dt._aureqs.length > 50) {
                      var size = 20,
                          data = dt._aureqs,
                          start = 0,
                          result = true;
                      while (true) {
                          dt._aureqs = data.slice(start, start + size);
                          if (!dt._aureqs.length) break;
      
                          if (!oldAu.sendNow(dt)) {
                              result = false;
                              break;
                          }
                          start += size;
                      }
                      if (start > 0 && start < data.length) {
                          dt._aureqs = data.slice(start);
                      }
                      return result;
                  } else {
                      return oldAu.sendNow(dt);
                  }
              }
          });
      

            rudyhuang rudyhuang
            rudyhuang rudyhuang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 6 hours Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - 6 hours Remaining Estimate - 2 hours
                6h