Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6538

Let users disable sending Content-Type with empty requests with URLConnection conduit

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.3, 3.0.7
    • Component/s: Transports
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      If no Content-Type is set for empty requests then HttpUrlConnection:

      • sets a form Content-Type for empty POST
      • replaces custom Accept value with a wildcard if HTTP proxy is used

      To bypass it CXF sets a wildcard CT for empty requests which causes issues if the target server does not accept such a wildcard.

      CXF RS code can override it with a preferred CT if needed, but sending CT with GET is better be avoided so a new property "set.content.type.for.empty.request" is introduced (note no 'wildcard' in the property name to let us default to something else if needed).

      The property is set to true by default. If a user sets it directly to false then CT will be dropped. Hopefully this property can be disabled by default in the future.

      Note the issue applies to a default non-async conduit only. Setting the property is not needed if it is the async conduit.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              sergey_beryozkin Sergey Beryozkin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: