Hello Albert and Paul,

you still have access to the full set of headers of the request:
Form headers = (Form)
getRequest().getAttributes().get(HeaderConstants.ATTRIBUTE_HEADERS);
for (Parameter parameter : headers) {
   System.out.println(parameter.getName() + " => " + parameter.getValue());
}

It should help to decide if the list of addresses is correctly parsed or
not.

Best regards,
Thierry Boileau



Thanks very much for the response!
> I tried your suggestion, but it didn't work for me.  I tried adding your
> code before the Router was created and also in the Resource class.  Here is
> what I have in my in my Application class:
>
>
> public class XNATApplication extends Application {
>        public XNATApplication(Context parentContext) {
>        super(parentContext);
>    }
>
>    @Override
>    public synchronized Restlet createRoot() {
>
>        org.restlet.Context c = this.getContext();
>        c.getParameters().add("useForwardedForHeader", "true");
>
>        Router router = new Router(getContext());
>
>
> router.attach("/experiments/{ASSESSED_ID}/scans/{SCAN_ID}/files",FileList.class);
> // .... attach other endpoints here.
> }
>
>
>
> Then in my FileList class I have:
>
>
> // .... code removed for brevity
>        org.restlet.Context c = this.getContext();
>        c.getParameters().add("useForwardedForHeader", "true");
>        org.restlet.data.ClientInfo client_info =
> this.getRequest().getClientInfo();
>
>        logger.info("[download," + project + ","+ login + "," +
>  child.getCanonicalPath()  + "," + child.length() + "," +
> client_info.getAddresses().toString() + "] **-**" );
>
> // .... code removed for brevity
>
>
>
> Here is what is coming out in the log files:
>
>
> [download,fcon_1000,guest,/export/xnat-int/xnat_archive/fcon_1000/arc001/AnnArbor_sub18698/SCANS/AnnArbor_sub18698_func_rest.nii.gz/BRIK/scan_rest.nii.gz,64097001,[132.239.131.178]]
>
> So I am getting a list of addresses from getAddresses, but it is only the
> proxy server...not the real client.
>
>
> Any other suggestions?
>
> -Al
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2790390
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2794245

Reply via email to