You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org> on 2009/10/01 09:44:23 UTC
[jira] Created: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
------------------------------------------------------------------------------
Key: SYNAPSE-587
URL: https://issues.apache.org/jira/browse/SYNAPSE-587
Project: Synapse
Issue Type: Bug
Components: Transports
Affects Versions: 1.2, NIGHTLY
Environment: Any
Reporter: Hiranya Jayathilaka
Assignee: Hiranya Jayathilaka
Fix For: 1.3
Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
<quote>
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
</quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761494#action_12761494 ]
Hiranya Jayathilaka commented on SYNAPSE-587:
---------------------------------------------
I have implemented this feature in a very flexible manner as proposed by Ruwan. Now when the content type header is not present on a response we try to determine the content type by inspecting message context properties and Axis2 properties. If that doesn't work we set the default content type as "application/octet-stream".
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779868#action_12779868 ]
Hiranya Jayathilaka commented on SYNAPSE-587:
---------------------------------------------
Hi Asankha,
I have implemented a possible fix in the 1.3 branch for the issues mentioned in the above mail thread. I have tested the new fix with some HTTP 204 responses and it seems to be working. The original problem that I tried to solve is also no longer there. Could you please verify the REST scenarios are working as expected?
Thanks,
Hiranya
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777393#action_12777393 ]
Hiranya Jayathilaka commented on SYNAPSE-587:
---------------------------------------------
Hi Asankha,
Thanks for pointing this out. I will revise my fix and make the necessary changes.
However in the above mentioned mail thread the scenario [1] indicates a situation where a message which actually had the Content-Type header was treated as binary. Currently the transport assigns the type "application/octet-stream" for messages that do not have a Content-Type header. So can you think of a reason why that message was treated as binary?
Thanks,
Hiranya
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Resolved: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hiranya Jayathilaka resolved SYNAPSE-587.
-----------------------------------------
Resolution: Fixed
Resolving the issue as per the last comment by Asankha. If there are any more regressions please feel free to reopen the issue.
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779811#action_12779811 ]
Asankha C. Perera commented on SYNAPSE-587:
-------------------------------------------
Hi Hiranya
Not sure I understand the requirement correctly.. if a content type is not specified, is it wrong to assume binary? Does it fail any known use cases?
I am particularly interested in ensuring that full REST support does go into 1.3 release, as a user is waiting to use this facility.. and hence would be grateful if you could ensure the fixes for it is not broken, and take this case separate if possible
thanks
asankha
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Resolved: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hiranya Jayathilaka resolved SYNAPSE-587.
-----------------------------------------
Resolution: Fixed
Fixed on the release branch and the trunk
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761122#action_12761122 ]
Hiranya Jayathilaka commented on SYNAPSE-587:
---------------------------------------------
See http://markmail.org/message/rdjapk64fi5sbknx for the related discussion
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Reopened: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Asankha C. Perera reopened SYNAPSE-587:
---------------------------------------
Hi Hiranya
This fix has broken the raw HTTP support Synapse had.. The HTTP spec talks only about "message containing an entity-body..." but there are responses etc that does not contain an entity body, in which case this creates a serious bug as shown in http://markmail.org/thread/o33ypagpv7txikrb
Could you fix this back to ensure that REST/POX and raw HTTP support will work as before?
thanks
asankha
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-587) NHTTP Transport Does Not Handle
Responses With No Content-Type Header Properly
Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779918#action_12779918 ]
Asankha C. Perera commented on SYNAPSE-587:
-------------------------------------------
Hi Hiranya
This works well with REST again!
many thanks
asankha
> NHTTP Transport Does Not Handle Responses With No Content-Type Header Properly
> ------------------------------------------------------------------------------
>
> Key: SYNAPSE-587
> URL: https://issues.apache.org/jira/browse/SYNAPSE-587
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: 1.2, NIGHTLY
> Environment: Any
> Reporter: Hiranya Jayathilaka
> Assignee: Hiranya Jayathilaka
> Fix For: 1.3
>
>
> Currently the NHTTP transport would assume an empty payload for response messages which do not have the HTTP Content-Type header. According to the HTTP/1.1 specification this should be handled as follows.
> <quote>
> Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
> </quote>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org