Skip to content

Commit 0555b38

Browse files
committed
Add support for alternative CDN when downloading packages
Since the actual download URL is returned by the Thunderstore API as a redirect, signal the API with a query parameter that an alternative CDN is preferred. Refs TS-2003
1 parent be611de commit 0555b38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/model/ThunderstoreVersion.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Mod from './Mod';
22
import VersionNumber from './VersionNumber';
33
import ReactiveObjectConverterInterface from './safety/ReactiveObjectConverter';
4+
import CdnProvider from '../providers/generic/connection/CdnProvider';
45

56
export default class ThunderstoreVersion extends Mod implements ReactiveObjectConverterInterface {
67

@@ -35,10 +36,10 @@ export default class ThunderstoreVersion extends Mod implements ReactiveObjectCo
3536
}
3637

3738
public getDownloadUrl(): string {
38-
return this.downloadUrl;
39+
return CdnProvider.addCdnQueryParameter(this.downloadUrl);
3940
}
4041

4142
public setDownloadUrl(url: string) {
4243
this.downloadUrl = url;
4344
}
44-
}
45+
}

0 commit comments

Comments
 (0)