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

HttpServletRequestImpl won't parse form data after getInputStream() or getReader() are called.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 2.3.20.Final
    • Servlet
    • None
    • Hide

      In a jakarta.servlet.Filter:

       

       

      @Override
      public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
      throws IOException, ServletException {
          ServletInputStream in = request.getInputStream();
          Map<String, String[]> params = request.getParameterMap();
      }

       

       

      Pass a request with form params. The "params" variable will contain null.

      Show
      In a jakarta.servlet.Filter:     @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { ServletInputStream in = request.getInputStream();  Map< String , String []> params = request.getParameterMap(); }     Pass a request with form params. The "params" variable will contain null.

      HttpServletRequestImpl.parseFormData() returns null if readStarted is true. Calls to get the input stream or a reader both set readStarted to true, even if nothing has been read from the input stream. To the client code, it looks like the request has content (getContentLength() returns a non zero value), but the parameters are missing.

       

       

              rhn-cservice-bbaranow Bartosz Baranowski
              mendicant_coder Eric Hodges (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: