jersey
  1. jersey
  2. JERSEY-1502

Invocation.Builder#header("Content-Encoding",..) is omitted.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Works as designed
    • Affects Version/s: 2.0-m09
    • Fix Version/s: 2.0-m13, 2.0
    • Component/s: None
    • Labels:
      None

      Description

      		Client client = ClientFactory.newClient();
      		WebTarget target = client
      				.target("....");
      		Invocation.Builder builder;
      		builder = target.request("*/*");
      		builder.header("Content-Encoding", "deflate");
      		Invocation i;
      		i = builder.build("POST", Entity.entity("aaa", MediaType.WILDCARD_TYPE));
      		Response r = i.invoke();
      

      results in:

      >> POST ....
      >> Accept:/, Transfer-Encoding:chunked, Content-Encoding:, Content-Type:/, Content-Language:

      Content-Encoding is not set. Content-Language is not set, too, even if header is set.

        Issue Links

          Activity

          Hide
          Marek Potociar added a comment -

          The expectations of the code above are invalid. The entity overrides Content-Encoding header that has been previously set, namely in this case it un-sets it (or sets it to null).

          I have updated the JAX-RS API javadoc to clarify this explicitly in the API. See JAX_RS_SPEC-347. Closing the issue as works as designed.

          Show
          Marek Potociar added a comment - The expectations of the code above are invalid. The entity overrides Content-Encoding header that has been previously set, namely in this case it un-sets it (or sets it to null ). I have updated the JAX-RS API javadoc to clarify this explicitly in the API. See JAX_RS_SPEC-347 . Closing the issue as works as designed.

            People

            • Assignee:
              Marek Potociar
              Reporter:
              jan.supol
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 hours
                3h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours Time Not Required
                2h