Skip to content

Commit 4e3406d

Browse files
committed
fix(tusc): Location header may not present
1 parent c1672cd commit 4e3406d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tusc.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ while [[ $# -gt 0 ]]; do
178178
-S | --no-spin) NOSPIN=1; shift ;;
179179
-u | --update) update; exit 0 ;;
180180
--version | version) version; exit 0 ;;
181-
--) shift; CURLARGS=$@; break ;;
181+
--) shift; CURLARGS=$@; break ;;
182182
*) if [[ $HOST ]]; then
183183
if [[ $FILE ]]; then SUMALGO="${SUMALGO:-$1}"; else FILE="$1"; fi
184184
else HOST=$1; fi
@@ -230,11 +230,9 @@ else
230230
-H 'Upload-Metadata: $META' \
231231
-X POST $HOST${BASEPATH:-/files/}"
232232
233-
TUSURL=${HEADERS[Location]}
234-
[[ $TUSURL ]] || error "Tus server replied with empty location. Try changing --base-path param." 1
235-
236233
# save location config
237-
tus-config ".[\"$KEY\"].location" "$TUSURL"
234+
TUSURL=${HEADERS[Location]}
235+
[[ $TUSURL ]] && tus-config ".[\"$KEY\"].location" "$TUSURL"
238236
fi
239237
240238
# patch request

0 commit comments

Comments
 (0)