Skip to content

Commit

Permalink
add user-agent to redit fetch header
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliiiu committed Jan 14, 2025
1 parent 3d4a583 commit 760f157
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pages/api/social-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export default async function handler(

const redditResponse = await fetch(
'https://www.reddit.com/r/everipedia/about.json',
{
headers: {
'User-Agent': 'IQ-UI/1.0',
},
},
).then((res) => {
if (!res.ok) throw new Error('Reddit API failed')
return res.json()
Expand Down

0 comments on commit 760f157

Please sign in to comment.