mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Fix curl helper without POST data
- Allow to use this helper without any POST data - Keep curl more quiet
This commit is contained in:
parent
12b7c438a9
commit
558323f6f2
1 changed files with 6 additions and 3 deletions
|
@ -46,9 +46,12 @@ ynh_local_curl () {
|
|||
do
|
||||
POST_data="${POST_data}${arg}&"
|
||||
done
|
||||
# (Remove the last character, which is an unecessary '&')
|
||||
POST_data=${POST_data::-1}
|
||||
if [ -n "$POST_data" ]
|
||||
then
|
||||
# Add --data arg and remove the last character, which is an unecessary '&'
|
||||
POST_data="--data \"${POST_data::-1}\""
|
||||
fi
|
||||
|
||||
# Curl the URL
|
||||
curl -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 --data "$POST_data" "$full_page_url" 2>&1
|
||||
curl --silent --show-error -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 $POST_data "$full_page_url"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue