Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8315461

When Expect-100 Continue support is enabled, failure reason is not remembered

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      When Expect: 100-Continue is sent in request headers, JDK [class: http/HttpURLConnection.java] waits for a successful HTTP 100 response. On not receiving it, it raises a ProtocolException which leads to connection to be disconnected.
      Field "rememberedException" is not however set.

      Later when the client calls on to getHeaderField() or getHeaderFields() to read the error response headers, it proceeds to make a new connection incorrectly.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.For a request with Expect: 100-Continue header, inject a failure response (i.e other than HTTP 100) when HttpUrlConnection getOutputStream API is called.
      2. Follow-up with a call to getHeaderFields() to be able to read the error response header.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      2 -> should return headers of the failed response from 1
      ACTUAL -
      2 -> reconnects fresh

      CUSTOMER SUBMITTED WORKAROUND :
      Can "rememberedException" be set when ProtocolException and RuntimeException is caught in getOutputStream()

            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: