-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix avatar infinite redirect #5299
Conversation
…irection by serving default
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self review done
@@ -11,6 +12,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) | |||
const username = req.query.username as string; | |||
const teamname = req.query.teamname as string; | |||
let identity; | |||
let linksToThisRoute = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let linksToThisRoute = false; | |
let isAvatarSourceWebAppUrl = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be a better variable name considering it can be WEBSITE_URL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't replicate from instructions, some NIT changes.
See this loom https://www.loom.com/share/c94e3a07d35c4a8d975fbae012a6fc36.
* If due to some reason avatar URL is same as route, avoid infinite redirection by serving default * Fix avatar reverting issue Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: alannnc <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* If due to some reason avatar URL is same as route, avoid infinite redirection by serving default * Fix avatar reverting issue Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: alannnc <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
The problem with this is that we're exceeding the payload limits due we're returning the whole image as codified data. We should query another endpoint for avatars specifically. |
Fixes #5213
Steps to replicate the issue