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

request.getParts should throw unwrapped IOException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Servlet
    • None

      In the event of an incomplete request where an IOException would be expected, request.getParts currently throws a RuntimeException wrapping the IOException:

      Caused by: java.lang.RuntimeException: java.io.IOException: UT000036: Connection terminated parsing multipart data
       at io.undertow.servlet@2.3.10.SP3-redhat-00001//io.undertow.servlet.spec.HttpServletRequestImpl.parseFormData(HttpServletRequestImpl.java:887)
       at io.undertow.servlet@2.3.10.SP3-redhat-00001//io.undertow.servlet.spec.HttpServletRequestImpl.loadParts(HttpServletRequestImpl.java:607)
       at io.undertow.servlet@2.3.10.SP3-redhat-00001//io.undertow.servlet.spec.HttpServletRequestImpl.getParts(HttpServletRequestImpl.java:558)
       at jakarta.servlet.api@6.0.0.redhat-00001//jakarta.servlet.http.HttpServletRequestWrapper.getParts(HttpServletRequestWrapper.java:306)
       at jakarta.servlet.api@6.0.0.redhat-00001//jakarta.servlet.http.HttpServletRequestWrapper.getParts(HttpServletRequestWrapper.java:306)
       at deployment.cppEar.ear//org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:94)
       ... 93 more
      Caused by: java.io.IOException: UT000036: Connection terminated parsing multipart data
       at io.undertow.core@2.3.10.SP3-redhat-00001//io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.parseBlocking(MultiPartParserDefinition.java:249)
       at io.undertow.servlet@2.3.10.SP3-redhat-00001//io.undertow.servlet.spec.HttpServletRequestImpl.parseFormData(HttpServletRequestImpl.java:881)
       ... 98 more 

      The servlet spec notes that it should be expected that request.getPart(s) can throw an IOException so it seems it would make more sense for Undertow to throw the original IOException itself without wrapping it as a RuntimeException.

              rhn-cservice-bbaranow Bartosz Baranowski
              rhn-support-aogburn Aaron Ogburn
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: