-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
My BookStack version v22.11.1
when i run command
./bs_orig search -q time
i got 301 Moved Permanently html response
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://192.168.56.142/api/search?query=time">here</a>.</p>
<hr>
<address>Apache/2.4.52 (Ubuntu) Server at 192.168.56.142 Port 80</address>
</body></html>
the reason is an extra character / in the url
must be http://192.168.56.142/api/search?query=time and there are http://192.168.56.142/api/search/?query=time
my little fix solves this problem
diff bs_orig bs
527,528c527,534
<
< "$curl" "${curl_options[@]}" --request GET --url "$url/api/$endpoint${id:+/}$id${target:+/}$target"
---
> case $endpoint in
> docs|search|recycle-bin)
> "$curl" "${curl_options[@]}" --request GET --url "$url/api/$endpoint$id${target:+/}$target"
> ;;
> *)
> "$curl" "${curl_options[@]}" --request GET --url "$url/api/$endpoint${id:+/}$id${target:+/}$target"
> ;;
> esac
jorgy80236
Metadata
Metadata
Assignees
Labels
No labels