Skip to content

Commit

Permalink
Fixed marklogic-community#189: don't get port from browser for server…
Browse files Browse the repository at this point in the history
…-side localhost http-get
  • Loading branch information
grtjn committed Jul 7, 2015
1 parent aefee7f commit ffc6986
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/test-helper.xqy
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,15 @@ declare function helper:easy-url($url) as xs:string
{
if (fn:starts-with($url, "http")) then $url
else
fn:concat("http://localhost:", fn:tokenize(xdmp:get-request-header("Host"), ":")[2], if (fn:starts-with($url, "/")) then () else "/", $url)
fn:concat("http://localhost:", xdmp:get-request-port(), if (fn:starts-with($url, "/")) then () else "/", $url)
};

declare function helper:http-get($url as xs:string, $options as node()?)
{
let $uri :=
if (fn:starts-with($url, "http")) then $url
else
fn:concat("http://localhost:", fn:tokenize(xdmp:get-request-header("Host"), ":")[2], if (fn:starts-with($url, "/")) then () else "/", $url)
fn:concat("http://localhost:", xdmp:get-request-port(), if (fn:starts-with($url, "/")) then () else "/", $url)
return
xdmp:http-get($uri, $options)
};
Expand Down

0 comments on commit ffc6986

Please sign in to comment.