The options was never meant to be exposed in the rest-dsl, when it was created.

The options was for the built-in CORS support.





On Mon, Sep 14, 2015 at 9:26 PM, Charles Moulliard <ch0...@gmail.com> wrote:
> Hi,
>
> I think that the logic of this test is wrong (
> https://github.com/apache/camel/blob/master/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerChannelHandler.java#L95)
> as we will only pass it if the isRestrictedToOptions boolean is false
>
> That means that a HTTP request issued by curl, ... against the endpoint
> will only get a response when the HttpMethodRestrict != OPTIONS.
>
> As the goal of the HTTP options request is to get a Response Code 200 and
> the Allow Header with methods supported (required by example by Swagger Api
> with  CORS), that means that we can't use REST DSL
>
>            rest("/").id("rest-options")
>              .verb("options","/blog/article")
>              .route()
>              ...
>
>
> as the endpoint will be defined with httpMethodRestrict=OPTIONS
>
> [         Blueprint Extender: 3] BlueprintCamelContext          INFO
>  Route: route1 started and consuming from: Endpoint[
> http://0.0.0.0:9191/blog/article?httpMethodRestrict=OPTIONS]
>
>
> Is me reasoning correct
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition

Reply via email to