Hi If you do some from http to http proxy thingy, then it can often make better to remove existing CamelHttp headers before calling to / toD to clear those from interfering. There was a FAQ about this on the old website, not sure if it was migrated to the new.
On Tue, Oct 20, 2020 at 2:50 PM Lars Schaps <Lars.Schaps@msg.group> wrote: > > Hello Maillinglist > > I have a question/problem regarding the .toD feature to dynamically set the > endpoint for the http(s) protocol > > In my example call I have > > .toD("${exchangeProperty.rewrite}") > > With rewrite set to > > https://exampledomain/en/reminder-webservice-v2/reminder/offerDate/?throwExceptionOnFailure=false&httpClient.connectTimeout=10000&httpClient.socketTimeout=10000&bridgeEndpoint=true&sslContextParameters=mySSLContextParameters > > The command > > .to("log:INFO?showBody=true&showHeaders=true"); > > after the .toD() is showing me following output: > > 2020-10-20 13:23:57,143 [T:http-nio-8080-exec-3, C:test] INFO | > Exchange[ExchangePattern: InOut, Headers: {accept=*/*, > accept-encoding=gzip,deflate, CamelHttpCharacterEncoding=ISO-8859-1, > CamelHttpMethod=POST, CamelHttpPath=/au/offerDate, > CamelHttpResponseCode=301, CamelHttpResponseText=XXXXX RealURL redirect, > CamelHttpServletRequest=org.apache.catalina.connector.RequestFacade@12dcf186, > > CamelHttpServletResponse=org.apache.catalina.connector.ResponseFacade@180c0467, > CamelHttpUri=/proxy/v2/reminder/au/offerDate, > CamelHttpUrl=http://exampledomain/proxy/v2/reminder/au/offerDate, > CamelServletContextPath=/v2/reminder, Connection=keep-alive, > Content-Length=0, Content-Type=text/html; charset=UTF-8, Date=Tue, 20 Oct > 2020 11:23:57 GMT, Location=https://exampledomain/en/reminder-webservice- > v2/reminder/offerDate/au/offerDate/, Server=nginx, > Strict-Transport-Security=max-age=31536000, X-Content-Type-Options=nosniff, > X-TYPO3-RealURL-Info=redirect for missing slash, X-XSS-Protection=1; > mode=block}, BodyType: > org.apache.camel.converter.stream.CachedOutputStream.WrappedInputStream, > Body: [Body is instance of java.io.InputStream]] > > I expect the target host to receive a request > > https://exampledomain/en/reminder-webservice-v2/reminder/offerDate/ > > like it was set via .toD(), but instead it receives (like in "Location" of > the log message) > > > https://exampledomain/en/reminder-webservice-v2/reminder/offerDate/au/offerDate/ > > with an extra > > au/offerDate > > Which causes trouble. > > What am I doing wrong and how can I fix this? > > Camel 3.4.3 > Tomcat 8.5 > Java 8 openjdk > > Kind regards > Lars > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2