camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <hekon...@gmail.com>
Subject Re: HTTP OPTIONS
Date Thu, 23 Apr 2015 09:16:13 GMT
Hi,

I've fixed some OPTIONS/CORS related issues in Netty HTTP component. After
these [1] two [2] changes (scheduled for 2.16 and 2.15.2) you can finally
call Netty HTTP based REST DSL routes from AngularJS without running into
the OPTIONS problems.

If you wait for Camel 2.15.2 and use Netty HTTP as a REST provider, you can
enjoy your favorite JS framework calling your REST API without any issues.

Cheers.

[1] https://issues.apache.org/jira/browse/CAMEL-8685
[2] https://issues.apache.org/jira/browse/CAMEL-8645

czw., 23.04.2015 o 10:57 u┼╝ytkownik Claus Ibsen <claus.ibsen@gmail.com>
napisał:

> Hi
>
> What http component do you use? servlet / jetty / or something else?
> And what version of Camel.
>
> There is a few tickets about rest-dsl and CORS issues still to get
> fixed / improved.
>
> On Thu, Apr 23, 2015 at 10:18 AM, Ted <nable@pritchard.uk.net> wrote:
> > Hi,
> >
> > I have a simple REST DSL route that has both a GET and a PUT for a
> > particular resource:
> >
> >         rest("/orders")
> >                 .get("/{orderId}").outType(Order.class)
> >                         .to("direct:getOrder")
> >                 .put("/{orderId}").type(Order.class)
> >                         .to("direct:updateOrder");
> >
> >
> > This application is run on a different port to the consuming application
> so
> > I have enabled CORS via a servlet filter (I also tried the enable CORS
> > option on the configuration of REST DSL).  The consuming application is
> > sending a pre-flight HTTP OPTIONS request.  I can see in the class
> > ServletRestServletResolveConsumerStrategy that the method
> > matchRestMethod(method, restrict) has special provision for the OPTIONS
> > method.  The problem for me seems to be that if the consuming application
> > sends a method similar to:
> >
> > /orders/1 OPTIONS
> >
> > Then the ServletRestServletResolveConsumerStrategy class is not able to
> find
> > a unique match because both the GET and the PUT methods are matched and
> the
> > consumer sees a 404.
> >
> > Is there something I'm missing?
> >
> > Ted
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/HTTP-OPTIONS-tp5766194.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8 <http://hawt.io/fabric8>: http://fabric8.io/
>

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