Skip to content

Commit

Permalink
Update postToMap.sh: workaround for User-Agent of "curl"
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Nov 3, 2024
1 parent 0e66a6c commit e2cbb4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/postToMap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function check_URL()
E="ERROR: ${FIELD_NAME} '${URL}' must begin with 'http:' or 'https:'.${BR}${E}"

else
# Make sure it's a valid URL
local CONTENT="$( curl --location --head --silent --show-error --connect-timeout ${TIMEOUT} "${URL}" 2>&1 )"
# Make sure it's a valid URL. Some servers don't return anything if the user agent is "curl".
local CONTENT="$( curl --user-agent Allsky --location --head --silent --show-error --connect-timeout ${TIMEOUT} "${URL}" 2>&1 )"
local RET=$?
[[ ${DEBUG} == "true" ]] && echo -e "\n${wDEBUG}check_URL() RET=${RET}:\n${CONTENT}${wNC}.\n"
if [[ ${RET} -eq 6 ]]; then
Expand Down

0 comments on commit e2cbb4e

Please sign in to comment.