camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <ch0...@gmail.com>
Subject HTTP Options request (netty-http, netty4-http)
Date Mon, 14 Sep 2015 19:26:34 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message