Skip to content

Commit 67877a0

Browse files
committed
add -f flag to curl in api_call()
- it's --fail in its long form - this causes curl to exit w/ error for all HTTP response codes at 400 or greater
1 parent 9cb63ac commit 67877a0

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

imgurbash2

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ api_call() {
152152
-m "$API_CALL_TIMEOUT_SEC" \
153153
--retry "$API_CALL_RETRIES" \
154154
--stderr - \
155-
-sSL \
155+
-fsSL \
156156
"${hdrs[@]}" \
157157
"$IMGUR_API/$IMGUR_API_VER/$resource"
158158
}
@@ -621,6 +621,7 @@ persist_tokens() {
621621
# @param {string} url url to uploaded image to be deleted.
622622
#
623623
# @returns {void}
624+
# shellcheck disable=SC2329
624625
delete_image_auto() {
625626
local dhash url response
626627

@@ -648,19 +649,17 @@ setup
648649

649650
############# START CONFIG #############
650651
LOGIN=false # true if we should authenticate with our own user.
651-
ALBUM_ID=""
652+
ALBUM_ID=''
652653

653654
API_CALL_CONNECT_TIMEOUT_SEC=5
654655
API_CALL_TIMEOUT_SEC=60
655656
API_CALL_RETRIES=1
656657

657658
LOG_FILE="$CONF_ROOT/log"
658659

659-
AUTO_DELETE_DELAY="" # if set, uploaded image(s) will be deleted after this delay
660+
AUTO_DELETE_DELAY='' # if set, uploaded image(s) will be deleted after this delay
660661

661-
# if the config file exists and is not empty...
662662
if [[ -s "$CONF_FILE" ]]; then
663-
# load configuations
664663
source "$CONF_FILE"
665664
fi
666665

0 commit comments

Comments
 (0)