Browse Source

Prevent URL redirection for mod latest version

Removed redirect resolution for mod download URLs to prevent issues with expiring signed URLs.
pull/4929/head
xe1os 2 weeks ago
committed by GitHub
parent
commit
6bfe4d3557
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      lgsm/modules/mods_core.sh

12
lgsm/modules/mods_core.sh

@ -35,7 +35,6 @@ fn_mod_install_files() {
# This compares the resolved download URL + filename.
fn_mod_latest_version_marker() {
modversionfile="${modsdir}/${modcommand}-version.txt"
modlatesturlfile="${modsdir}/${modcommand}-latest-url.txt"
if [ -z "${modurl}" ] || [ "${modurl}" == "null" ]; then
fn_print_fail_nl "${modprettyname}: missing download URL"
@ -51,14 +50,9 @@ fn_mod_latest_version_marker() {
core_exit.sh
fi
# Resolve redirects when possible. Useful for GitHub latest/download links.
modlatesturl="$(curl -fsIL -o /dev/null -w '%{url_effective}' "${modurl}" 2>/dev/null || true)"
if [ -z "${modlatesturl}" ]; then
modlatesturl="${modurl}"
fi
modlatestversion="${modlatesturl}|${modfilename}"
# Do NOT resolve redirects here.
# GitHub asset redirects contain expiring signed URLs and will change every run.
modlatestversion="${modurl}|${modfilename}"
}
# Save currently installed mod version marker.

Loading…
Cancel
Save