Skip to content

Commit f5007dc

Browse files
committed
[fix] redirects in find.xq
`response:redirect-to` does include the scheme and domain which is a) not needed b) can be plain wrong for instances behind a proxy
1 parent 3deb386 commit f5007dc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

modules/find.xq

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ return
4444
$newest-compatible-package/version ! attribute version {.},
4545
$newest-compatible-package/@path
4646
}
47-
else if ($zip) then
48-
response:redirect-to(xs:anyURI($abs-public || $xar-filename || ".zip"))
49-
else
50-
response:redirect-to(xs:anyURI($abs-public || $xar-filename))
47+
else if ($zip) then (
48+
response:set-status-code(302),
49+
response:set-header("Location", $abs-public || $xar-filename || ".zip")
50+
)
51+
else (
52+
response:set-status-code(302),
53+
response:set-header("Location", $abs-public || $xar-filename)
54+
)
5155
else
5256
(
5357
response:set-status-code(404),

0 commit comments

Comments
 (0)