Skip to content

Commit de75f2e

Browse files
authored
Use http/1.1 for CurseForge (#4155)
1 parent 175004e commit de75f2e

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.sh text eol=lf
2+
scripts/** text eol=lf

scripts/start-deployAutoCF

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ set -eu
2424
: "${CF_API_CACHE_DEFAULT_TTL:=}" # as ISO-8601 duration, such as P2D or PT12H
2525
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
2626
: "${CF_MOD_LOADER_VERSION:=}" # Override mod loader version
27+
: "${CF_USE_HTTP2:=false}" # CF downloads are faster with HTTP 1.1
2728

2829
resultsFile=/data/.install-curseforge.env
2930

@@ -46,6 +47,7 @@ args=(
4647
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
4748
--force-reinstall-modloader="$CF_FORCE_REINSTALL_MODLOADER"
4849
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
50+
--use-http2="$CF_USE_HTTP2"
4951
)
5052
setArg() {
5153
arg="${1?}"

scripts/start-setupModpack

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -e -o pipefail
1010
: "${REMOVE_OLD_MODS_DEPTH:=1} "
1111
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
1212
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
13+
: "${CF_USE_HTTP2:=false}" # CF downloads are faster with HTTP 1.1
1314
: "${MODRINTH_LOADER:=}"
1415

1516
# shellcheck source=start-utils
@@ -296,7 +297,9 @@ function handleModrinthProjects() {
296297
}
297298

298299
function handleCurseForgeFiles() {
299-
args=()
300+
args=(
301+
--use-http2="$CF_USE_HTTP2"
302+
)
300303
if usesMods && ! usesPlugins; then
301304
args+=(--default-category mc-mods)
302305
elif usesPlugins && ! usesMods; then

0 commit comments

Comments
 (0)