Skip to content
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 excessive requests to Google on initialisation #3218

Merged
merged 6 commits into from
Jan 27, 2025

Conversation

paulschatt
Copy link
Collaborator

@paulschatt paulschatt commented Jan 18, 2025

Purpose

When a user logs in with google, requests for the Avatar occasionally fail. After investigation, the issue seems to be caused by Google's API enforcing stricter restrictions on the Referer header. By adding the directive referrerpolicy="no-referrer", these restrictions can be bypassed.
Source: https://stackoverflow.com/questions/40570117/http403-forbidden-error-when-trying-to-load-img-src-with-google-profile-pic

Changes

When requesting a Google avatar, add referrerpolicy="no-referrer".

@paulschatt paulschatt requested a review from GspikeHalo January 18, 2025 00:48
@paulschatt paulschatt self-assigned this Jan 18, 2025
@paulschatt paulschatt changed the title Use share() instead of shareReplay() to support multicasting Fix excessive requests to Google on initialisation Jan 18, 2025
@GspikeHalo GspikeHalo self-assigned this Jan 25, 2025
@GspikeHalo GspikeHalo marked this pull request as ready for review January 25, 2025 23:40
@GspikeHalo GspikeHalo removed their request for review January 26, 2025 02:53
Copy link
Collaborator

@aglinxinyuan aglinxinyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@GspikeHalo GspikeHalo merged commit 726fe3e into master Jan 27, 2025
8 checks passed
@GspikeHalo GspikeHalo deleted the schatt-fix-avatar-excessive-request branch January 27, 2025 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants