mirror of
https://codeberg.org/vlw/curl.git
synced 2026-04-13 02:39:38 +02:00
fix: append search parameters only if set
This commit is contained in:
parent
832bea4252
commit
7a1200614f
1 changed files with 4 additions and 1 deletions
3
curl.sh
3
curl.sh
|
|
@ -23,7 +23,10 @@ method="${2:-GET}"
|
|||
if [ -f $REQ_PARAMS_FILE ]; then
|
||||
# Parse each newline as a separate parameter joined by a "&"
|
||||
params=$(tr '\n' '&' < "$REQ_PARAMS_FILE" | sed 's/&$//')
|
||||
|
||||
if [ -n "$params" ]; then
|
||||
url="${url}?${params}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Prepare curl
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue