Skip to content

Commit 9483ccf

Browse files
paulschattTexeraGspikeHalo
authored andcommitted
Fix excessive requests to Google on initialisation (#3218)
### 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". --------- Co-authored-by: Texera <[email protected]> Co-authored-by: shenghao fu <[email protected]> Co-authored-by: GspikeHalo <[email protected]>
1 parent 7f6650a commit 9483ccf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/gui/src/app/common/service/user/user.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class UserService {
125125

126126
private fetchBlob(url: string): Observable<Blob> {
127127
return new Observable(observer => {
128-
fetch(url)
128+
fetch(url, { referrerPolicy: "no-referrer" })
129129
.then(response => {
130130
if (!response.ok) {
131131
throw new Error(`HTTP error! status: ${response.status}`);

0 commit comments

Comments
 (0)