File tree Expand file tree Collapse file tree 2 files changed +21
-15
lines changed
Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 3333 DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK }}
3434 DISCORD_ADMIN_IDS : ${{ secrets.DISCORD_ADMIN_IDS }}
3535 FORCE_UPLOAD : ${{ contains(github.event.head_commit.message, 'force upload') && github.event_name == 'push' }}
36- PROXY_AUTH : ${{ secrets.PROXY_AUTH }}
36+ WARFRAME_ORIGIN_PROXY : ${{ secrets.WARFRAME_ORIGIN_PROXY }}
37+ X_PROXY_TOKEN : ${{ secrets.X_PROXY_TOKEN }}
3738 - name : Authenticate Firebase
3839 uses : ' google-github-actions/auth@v2'
3940 with :
Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ import fetch from "node-fetch";
22import lzma from "lzma" ;
33
44const CONTENT_URL = "https://content.warframe.com" ;
5- const ORIGIN_URL = process . env . PROXY_AUTH
6- ? "https://wf-origin-proxy.aericio.workers.dev"
7- : "https://origin.warframe.com" ;
5+ const ORIGIN_URL =
6+ process . env . WARFRAME_ORIGIN_PROXY ?? "https://origin.warframe.com" ;
87
98let endpoints ;
109
@@ -13,18 +12,24 @@ function parseDamagedJSON(json) {
1312}
1413
1514async function fetchEndpoints ( ) {
15+ const headers = { } ;
16+
17+ if ( process . env . X_PROXY_TOKEN ) {
18+ headers [ "X-Proxy-Token" ] = process . env . X_PROXY_TOKEN ;
19+ }
20+
21+ const response = await fetch ( `${ ORIGIN_URL } /PublicExport/index_en.txt.lzma` , {
22+ headers
23+ } ) ;
24+
25+ if ( ! response . ok ) {
26+ throw new Error (
27+ `Failed to fetch endpoints: ${ response . status } ${ response . statusText } `
28+ ) ;
29+ }
30+
1631 endpoints = lzma
17- . decompress (
18- Buffer . from (
19- await (
20- await fetch ( `${ ORIGIN_URL } /PublicExport/index_en.txt.lzma` , {
21- headers : {
22- Authentication : process . env . PROXY_AUTH
23- }
24- } )
25- ) . arrayBuffer ( )
26- )
27- )
32+ . decompress ( Buffer . from ( await response . arrayBuffer ( ) ) )
2833 . split ( "\n" ) ;
2934}
3035
You can’t perform that action at this time.
0 commit comments