Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.1.1
  • Fix Version/s: 3.1.4 (EE only)
  • Component/s: Core: Transports
  • Labels:
    None
  • User impact:
    Medium
  • Similar Issues:
    None

Description

When using and method=PUT endpoint contentType won't be set (while for POST work perfectly fine) :

<http:endpoint name="exampleEndpoint" exchange-pattern="request-response"
method="PUT" host="hostname.com" port="80" path="pathtowhatever"
user="johndoe" password="dummy" contentType="application/xml" encoding="UTF-8" >
</http:endpoint>

Because on ObjectToHttpClientMethodRequest.java, there are two methods to create an HttpMethod, one for post createPostMethod and one for put createPutMethod, only the post one have this piece of code :

// if a content type was specified on the endpoint, use it
String outgoingContentType = msg.getInvocationProperty(HttpConstants.HEADER_CONTENT_TYPE);
if (outgoingContentType != null)

{ postMethod.setRequestHeader(HttpConstants.HEADER_CONTENT_TYPE, outgoingContentType); }

So as createPutMethod doen't have it, the method won't be set.

There is a dirty workaround. Adding an outbound property to the message named "Content-type" with the desired value. This will workaround it as in ObjecttoHttpClientMethodRequest.java in the method setupEntityMethod theres an : String outboundMimeType = (String) msg.getProperty(HttpConstants.HEADER_CONTENT_TYPE, PropertyScope.OUTBOUND);

Anyway a proper content-type handling for PUT is recommendable.

Issue Links

Activity

Hide
Pablo Kraan added a comment -

Same issue reported by the same guy. Already fixed in 3.2.x/3.x

Show
Pablo Kraan added a comment - Same issue reported by the same guy. Already fixed in 3.2.x/3.x
Hide
Pablo Kraan added a comment -
Show
Pablo Kraan added a comment - Fix 3.1.x http://fisheye.codehaus.org/changelog/mule/?cs=23671
Hide
Victor Romero added a comment -

The logic behind the duplicated issue is that, the only "legal" way to send a patch for a external collaborator is to use "Patch submission". If I attach it to a regular issue the ownership of the patch will be still of mine.

Anyway I tried to clarify it in the other issue description you mentioned :
"""Patch submision to fix MULE-5504 (I´m assuming the creation of this issue is correct as the CLA should be agreed)."""

It's almost one year old (it's lovely to see the patch finally applied, even one year later) and nobody ever told me nothing so I assume it's ok.

Please let me know if it's not ok to submit patches for an already existing issue as a "patch submission".

(another point is that external collaborators can't link issues so a "ISSUE fixes ISSUE" wasn't possible)

Show
Victor Romero added a comment - The logic behind the duplicated issue is that, the only "legal" way to send a patch for a external collaborator is to use "Patch submission". If I attach it to a regular issue the ownership of the patch will be still of mine. Anyway I tried to clarify it in the other issue description you mentioned : """Patch submision to fix MULE-5504 (I´m assuming the creation of this issue is correct as the CLA should be agreed).""" It's almost one year old (it's lovely to see the patch finally applied, even one year later) and nobody ever told me nothing so I assume it's ok. Please let me know if it's not ok to submit patches for an already existing issue as a "patch submission". (another point is that external collaborators can't link issues so a "ISSUE fixes ISSUE" wasn't possible)
Hide
Pablo Kraan added a comment -

Maybe we can give you more access, you already submitted lots of bugs/fixes
I think your reasoning is valid, the problem is that the fix for 3.1.x was missed when fixing the other issue.
Thanks for helping

Show
Pablo Kraan added a comment - Maybe we can give you more access, you already submitted lots of bugs/fixes I think your reasoning is valid, the problem is that the fix for 3.1.x was missed when fixing the other issue. Thanks for helping

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: