Skip to content

Commit

Permalink
include user-agent for icanhazdadjoke per terms of service request
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Ziaei committed Apr 9, 2024
1 parent 84a98b1 commit 4215f1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/app/src/services/jokes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export async function getRandomDadJoke() {
const response = await fetch('https://icanhazdadjoke.com/', {
headers: { Accept: 'text/plain' },
headers: {
Accept: 'text/plain',
'User-Agent':
'daily-dad-jokes-ig (https://github.com/amir-ziaei/daily-dad-jokes-ig)',
},
})
return (await response.text()).trim()
}

0 comments on commit 4215f1c

Please sign in to comment.