File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/console/app/src/lib Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,21 +2,25 @@ import { query } from "@solidjs/router"
22
33export const github = query ( async ( ) => {
44 "use server"
5+ const headers = {
6+ UserAgent :
7+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" ,
8+ }
59 try {
610 const [ meta , releases , contributors ] = await Promise . all ( [
7- fetch ( "https://api.github.com/repos/sst/opencode" ) . then ( async ( res ) => {
11+ fetch ( "https://api.github.com/repos/sst/opencode" , { headers } ) . then ( async ( res ) => {
812 const text = await res . text ( )
913 console . log ( text )
1014 const json = JSON . parse ( text )
1115 return json
1216 } ) ,
13- fetch ( "https://api.github.com/repos/sst/opencode/releases" ) . then ( async ( res ) => {
17+ fetch ( "https://api.github.com/repos/sst/opencode/releases" , { headers } ) . then ( async ( res ) => {
1418 const text = await res . text ( )
1519 console . log ( text )
1620 const json = JSON . parse ( text )
1721 return json
1822 } ) ,
19- fetch ( "https://api.github.com/repos/sst/opencode/contributors?per_page=1" ) ,
23+ fetch ( "https://api.github.com/repos/sst/opencode/contributors?per_page=1" , { headers } ) ,
2024 ] )
2125 const [ release ] = releases
2226 const contributorCount = Number . parseInt (
You can’t perform that action at this time.
0 commit comments