File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -584,6 +584,7 @@ function api:restxq() {
584584 )
585585};
586586
587+
587588declare
588589 %rest:POST("{$body}" )
589590 %rest:path("/pebble/query" )
@@ -605,7 +606,7 @@ function api:query($range-header, $body) {
605606 then
606607 api:cors-allow (
607608 map {
608- "code" : $hsc:unauthorized ,
609+ "code" : $hsc:forbidden ,
609610 "reason" : "Guest is not allowed to execute arbitary queries"
610611 },
611612 ()
Original file line number Diff line number Diff line change @@ -16,7 +16,16 @@ import module namespace util = "http://exist-db.org/xquery/util";
1616 :)
1717declare function qry:execute ($query-data as map (xs:string, xs:string),
1818 $start as xs:integer?, $length as xs:integer?) as xs:string {
19- let $query := $query-data?query
19+
20+ let $query :=
21+ if ($query-data?query-uri)
22+ then
23+ let $query-doc := util:binary-doc ($query-data?query-uri)
24+ return
25+ util:base64-decode ($query-doc)
26+ else
27+ $query-data?query
28+
2029 let $serialization := $query-data?defaultSerialization
2130 let $eval-ser-fn :=
2231 if (not (empty ($start)) and not (empty ($length)))
You can’t perform that action at this time.
0 commit comments