Hi All,

 

I've use the following code for proxy server:

 

let $proxy := " <http://172.21.10.60:3128> http://172.21.10.60:3128"; (:
simple http proxy :)

let $uri := "
<http://www.austlii.edu.au/cgi-bin/sinosrch.cgi?results=200;query=damage%22>
http://www.austlii.edu.au/cgi-bin/sinosrch.cgi?results=200;query=damage";(:
target web service :)

 

xdmp:http-get-proxy($proxy, $uri)

 

declare function local:http-get-proxy($proxy, $uri){

  let $host := fn:tokenize($uri,'/')[3]

  let $proxyuri := fn:concat($proxy,"?",$uri)

  return xdmp:http-get($proxyuri,

    <options xmlns="xdmp:http"> 

      <headers> 

        <host>{$host}</host>

      </headers>

    </options>)

};

 

 

but having bad request as the request URL is 

 

172.21.11.61 NONE/400 3447 GET
/http://www.austlii.edu.au/cgi-bin/sinosrch.cgi?results=200;query=hello -
NONE/- text/html

 

Have an extra forward slash in front of the URL. Tested the xquery and look
at the proxy server, it seem that the extra slash is coming directly from
Marklogic.

The current installed Marklogic is 7.0-2.3

 

Anyone able to help?

 

 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to