From 070af11343f4f52821f784dcbf18b28aadef3509 Mon Sep 17 00:00:00 2001 From: Maddie <52103563+maddie480@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:58:41 +0100 Subject: [PATCH] Fix crash when following redirect if no headers are passed --- changelog.txt | 2 +- src/utils.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index ec709f8..e374217 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,4 +3,4 @@ and only contains the latest changes. Its purpose is to be shown in Olympus when updating. #changelog# -∙ Fixed Lönn freezing during startup when ran through Olympus on Windows \ No newline at end of file +∙ Fixed crash when following redirect while downloading a mod \ No newline at end of file diff --git a/src/utils.lua b/src/utils.lua index 359fd60..ef8d0d4 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -175,6 +175,7 @@ function utils.download(url, headers) if not redirect then return false, code, body end + headers = headers or {} headers["Referer"] = url url = redirect goto retry