File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ const images = async (req: NextApiRequest, res: NextApiResponse) => {
3333 // Get the image from the cache if it exists
3434 const image = imageCache . get ( req . query . login as string ) ;
3535 if ( image ) {
36- res . send ( image as Buffer ) ;
36+ res . status ( 200 ) . send ( image as Buffer ) ;
3737 } else {
3838 // Fetch the image from the user-photos server if it's not in the cache
3939 const response = await fetch ( `${ userPhotosServer } /${ req . query . login } /100` ) ;
@@ -42,7 +42,7 @@ const images = async (req: NextApiRequest, res: NextApiResponse) => {
4242 if ( response . ok ) {
4343 console . log ( `Cache miss for ${ req . query . login } , fetching image from user-photos.codam.nl...` ) ;
4444 imageCache . set ( req . query . login as string , buffer , 3600 ) ; // Cache the image for 1 hour
45- res . status ( response . status ) . send ( buffer ) ;
45+ res . status ( 200 ) . send ( buffer ) ;
4646 } else {
4747 console . log ( `Failed to fetch image for ${ req . query . login } from user-photos.codam.nl` ) ;
4848 res . status ( response . status ) . send ( buffer ) ;
You can’t perform that action at this time.
0 commit comments