File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const CONTENT_URL = "https://content.warframe.com";
55const ORIGIN_URL =
66 process . env . WARFRAME_ORIGIN_PROXY ?? "https://origin.warframe.com" ;
77
8- let endpoints ;
8+ let endpointsPromise ;
99
1010function parseDamagedJSON ( json ) {
1111 return JSON . parse ( json . replace ( / \\ \" / g, "'" ) . replace ( / \n | \r | \\ / g, "" ) ) ;
@@ -28,16 +28,18 @@ async function fetchEndpoints() {
2828 ) ;
2929 }
3030
31- endpoints = lzma
31+ return lzma
3232 . decompress ( Buffer . from ( await response . arrayBuffer ( ) ) )
3333 . split ( "\n" ) ;
3434}
3535
3636export async function fetchEndpoint ( endpoint ) {
37- if ( ! endpoints ) {
38- await fetchEndpoints ( ) ;
37+ if ( ! endpointsPromise ) {
38+ endpointsPromise = fetchEndpoints ( ) ;
3939 }
4040
41+ const endpoints = await endpointsPromise ;
42+
4143 return parseDamagedJSON (
4244 await (
4345 await fetch (
You can’t perform that action at this time.
0 commit comments