0

I've been using restlet camel component to communicate with endpoints fine for a couple of weeks now, but after I had the need to add an Authorization header to my requests, that's when I kept getting this warning:

WARNING: Addition of the standard header "Authorization" is not allowed. Please use the equivalent property in the Restlet API.

Which blocks the header from being added to the outgoing message. I've seen solutions for this for using restlet, but I don't have the luxury when using it as a camel component.

I've tried using the org.restlet.http.headers attribute but still get the same message.

Any ideas how to make it send out my authorization header? (I would rather not use the http component)

Note: I'm using Camel 2.19.2, same version for restlet

Sari Alalem
  • 870
  • 7
  • 18

1 Answers1

0

There is a ticket at Restlet to support this, however they have not implemented this: https://github.com/restlet/restlet-framework-java/issues/1198

There is also a Camel ticket: https://issues.apache.org/jira/browse/CAMEL-10665

As it seems Restlet takes forever to fix this on their side, we may have to bit the bullet and make a special fix in the camel-restlet component

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Thanks Claus, I guess there isn't a workaround that involves using restlet for now. I'll keep my eye on the Camel ticket (if it will get some attention) – Sari Alalem Oct 05 '17 at 08:51
  • For future reference: The issue is in https://github.com/restlet/restlet-framework-java/blob/master/modules/org.restlet/src/org/restlet/engine/header/HeaderUtils.java in addExtensionHeaders, where it skips adding the header if it's found in the STANRD_HEADER set – Sari Alalem Oct 05 '17 at 08:56
  • Okay I got it implemented for Authorization now, will try to get a bunch of the others implemented as well. – Claus Ibsen Oct 05 '17 at 09:41
  • I can see that 2.20.0 was released, but Maven repository still doesn't have it. and I want to try out the fixes in it. – Sari Alalem Oct 12 '17 at 09:36
  • Sure it has - org.apache.camel camel-restlet 2.20.0 all (99) – Claus Ibsen Oct 12 '17 at 11:38
  • Thanks Claus, the fix seems to be working for me, I've tested with Authorization and Content-Type Headers – Sari Alalem Oct 12 '17 at 13:29