Hello Guido,
thanks for your post, it describes a big bug in the Redirector class that leads
to generate a request having the wrong "Host" header, when the Redirector class
targets a new domain. That's pretty curious, this has been discovered before.
I've updated the svn repository in both 2.0 branch and trunk.
>BTW, is there a way to switch on logging for ALL
> headers of request and response easily?
With Restlet 2.1, the internal client and server connectors have a "tracing"
mode.
I'm not aware there is this kind of feature for the 2.0 release.
As a workaround, you can also inherit from Server and Client and override the
"handle(Request, Response)" methods:
Server server = new Server(Protocol.HTTP, 8182) {
@Override
public void handle(Request request, Response response) {
System.out.println("server request : "
+ request.getAttributes().get(
HeaderConstants.ATTRIBUTE_HEADERS));
super.handle(request, response);
System.out.println("server response "
+ response.getAttributes().get(
HeaderConstants.ATTRIBUTE_HEADERS));
}
};
component.getServers().add(server);
Best regards,
Thierry Boileau
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2704838