Skip to content

Commit

Permalink
Added user agent to resolve url api requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHeitmann committed Jan 6, 2024
1 parent 11b91d8 commit 04f5848
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/serverScripts/photonApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ photonApiRouter.get("/resolveRedditUrl", RateLimit(tokenRequestRateLimitConfig),
do {
response = await fetch(url, {
redirect: "manual",
headers: {
"User-Agent": `web_backend:photon-reddit.com:v${photonVersion} (by /u/RaiderBDev)`
}
});
let newUrl = response.headers.get("location");
if (!newUrl)
Expand Down

0 comments on commit 04f5848

Please sign in to comment.