1
0
Fork 0

readwwwlog: fix text/plain check, only sleep for dpaste

This commit is contained in:
tastytea 2022-04-25 10:30:30 +02:00
parent 7b35fb38c9
commit 80933c33f5
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 2 additions and 4 deletions

View File

@ -43,12 +43,11 @@ for url in ${urls}; do
cmd=(${TERMINAL} ${termopts} -e ${cmd})
fi
if [[ ${headers[(I)*text/plain]} -ne 0 ]] || \
if [[ ${headers[(I)*text/plain*]} -ne 0 ]] || \
[[ ${headers[(I)*HTTP/1.1 405*]} -ne 0 ]]; then # No HEAD allowed
sleep 1 # dpaste.com workaround
[[ ${url} =~ 'dpaste\.com' ]] && sleep 1
curl --silent --location --output ${file} ${url}
${cmd} ${file}
rm ${file}
elif [[ ${headers[(I)*application/zip]} -ne 0 ]]; then
rm ${file}
@ -63,7 +62,6 @@ for url in ${urls}; do
${cmd} ${txt}
fi
done
rm -r ${dir}
else
${default_cmd} ${url}