File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ export const GET: APIRoute = async ({ url }) => {
8383 headers : {
8484 'Content-Type' : 'application/json' ,
8585 Accept : 'application/json' ,
86+ 'User-Agent' : 'sapphic.moe AniList API Proxy (Astro)' ,
8687 } ,
8788 body : JSON . stringify ( {
8889 query,
Original file line number Diff line number Diff line change @@ -64,15 +64,15 @@ export const GET: APIRoute = async ({ url }) => {
6464 ) ;
6565 }
6666
67- const headers = new Headers ( {
68- 'User-Agent' : 'sapphic.moe Lanyard API Proxy (Astro)' ,
69- } ) ;
70-
7167 const API_URL = `${ LANYARD_API_URL } /v1/users/${ userId } ` ;
7268
7369 for ( let attempt = 1 ; attempt <= MAX_RETRIES ; attempt ++ ) {
7470 try {
75- const apiRequest = await fetch ( API_URL , { headers } ) ;
71+ const apiRequest = await fetch ( API_URL , {
72+ headers : {
73+ 'User-Agent' : 'sapphic.moe Lanyard API Proxy (Astro)' ,
74+ } ,
75+ } ) ;
7676
7777 if ( ! apiRequest . ok ) {
7878 const errorBody = await apiRequest . text ( ) ;
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export const GET: APIRoute = async ({ url }) => {
6464 const apiUrl = `https://api.openweathermap.org/data/2.5/weather?${ params . toString ( ) } ` ;
6565
6666 const apiRequest = await fetch ( apiUrl , {
67- headers : { 'User-Agent' : 'Sapphic .moe Weather API Proxy (Astro)' } ,
67+ headers : { 'User-Agent' : 'sapphic .moe Weather API Proxy (Astro)' } ,
6868 } ) ;
6969
7070 if ( ! apiRequest . ok ) {
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ export const validateAlbumCover = async (url: string | null): Promise<string | n
2323 const response = await fetch ( url , {
2424 method : 'HEAD' ,
2525 signal : controller . signal ,
26+ headers : {
27+ 'User-Agent' : 'sapphic.moe Last.fm API Proxy (Astro)' ,
28+ } ,
2629 } ) ;
2730 clearTimeout ( timeoutId ) ;
2831
You can’t perform that action at this time.
0 commit comments