File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ export class Generator {
47
47
return result ;
48
48
}
49
49
50
- protected async fetch ( username : string , site : "us" | "cn" ) : Promise < FetchedData > {
50
+ protected async fetch (
51
+ username : string ,
52
+ site : "us" | "cn" ,
53
+ headers : Record < string , string > ,
54
+ ) : Promise < FetchedData > {
51
55
this . log ( "fetching" , username , site ) ;
52
56
const cache_key = `data-${ username . toLowerCase ( ) } -${ site } ` ;
53
57
@@ -61,11 +65,11 @@ export class Generator {
61
65
62
66
try {
63
67
if ( site === "us" ) {
64
- const data = await query . us ( username ) ;
68
+ const data = await query . us ( username , headers ) ;
65
69
this . cache . put ( cache_key , data ) . catch ( console . error ) ;
66
70
return data ;
67
71
} else {
68
- const data = await query . cn ( username ) ;
72
+ const data = await query . cn ( username , headers ) ;
69
73
this . cache . put ( cache_key , data ) . catch ( console . error ) ;
70
74
return data ;
71
75
}
You can’t perform that action at this time.
0 commit comments