[
https://issues.apache.org/jira/browse/CAMEL-11162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494914#comment-16494914
]
ASF GitHub Bot commented on CAMEL-11162:
----------------------------------------
GitHub user davsclaus opened a pull request:
https://github.com/apache/camel/pull/2354
CAMEL-11162: rest-dsl add client request validation
So we check whether required data is included in the client http request
when being processed by rest-dsl consumer.
We now check for missing
- query parameters
- http headers
- body
The context-path is already handled in the uri path matcher, so it will
fail already for invalid context-path.
This can be turned on in the rest configuration.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/camel rest-val
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/2354.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2354
----
commit 8f088e7fa1fb11e48ed4150ad460bad1d4dd1020
Author: Claus Ibsen <claus.ibsen@...>
Date: 2018-05-29T14:38:28Z
CAMEL-11162: rest-dsl now has validation check for consumer to check if the
http client request has content-type/accept headers that is supported in
rest-dsl consumes/produces settings.
commit c9ff0ce02d9d7ed72e84b5fb58a19d7820822300
Author: Claus Ibsen <claus.ibsen@...>
Date: 2018-05-30T06:45:56Z
CAMEL-11162: rest-dsl now has validation check for consumer to check if the
http client request has content-type/accept headers that is supported in
rest-dsl consumes/produces settings.
commit 066566dea22ed6dcc2978ca33b0707a6d0035f7f
Author: Claus Ibsen <claus.ibsen@...>
Date: 2018-05-30T09:03:49Z
CAMEL-11162: rest-dsl now has validation check for consumer to check if the
http client request has content-type/accept headers that is supported in
rest-dsl consumes/produces settings.
----
> camel-rest - Should we add content-type check for server side
> -------------------------------------------------------------
>
> Key: CAMEL-11162
> URL: https://issues.apache.org/jira/browse/CAMEL-11162
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 2.22.0
>
>
> For example setting up a rest-dsl which consumes application/json and then a
> client calls it with text/plain or application/xml, should we then automatic
> let rest consumer detect this and return a HTTP status 415 (unsuported media
> type)
> Not all the HTTP server components does this today, eg jetty etc. But when
> using restlet which is more natual REST it would do so.
> We could then add an option to turn this on|off.
> The check is only if the media-type is within the list that may have been
> specified on consumes in the rest-dsl.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)