Empty Image

The default avatar should take back to ui-avatars but im not getting an image..
No description
39 Replies
Jamie Cee
Jamie CeeOP13mo ago
No description
Jamie Cee
Jamie CeeOP13mo ago
Thats inspect element, and going to that url does have an image
leoPascal
leoPascal12mo ago
the 'APP_URL' in the project .env file must be same as the actaul url, for example if the url in the browser is "http://127.0.0.1.." then .env must have the same as 'APP_URL'.
Dennis Koch
Dennis Koch12mo ago
Sound unrelated. This is an image from a different page. Did you check console or network tab for errors? Did you open the URL and see whether it works?
Jamie Cee
Jamie CeeOP12mo ago
Opened url from inspect element. Works fine. No errors either
Dennis Koch
Dennis Koch12mo ago
Hm, that’s weird. What if you inspect it inside network tab. What’s the response?
Jamie Cee
Jamie CeeOP12mo ago
I shall have to check tomorrow when I'm at work
Jamie Cee
Jamie CeeOP12mo ago
Thats dead, but cant find anything to tell me why
No description
Jamie Cee
Jamie CeeOP12mo ago
Shouldnt be coz im on localhost?
Jamie Cee
Jamie CeeOP12mo ago
No description
Dennis Koch
Dennis Koch12mo ago
So there is an error. Can you shre the whole line? Also also the Response tab? Or is it just empty? It's probably because you try to embed https:// on a non-secure site
Jamie Cee
Jamie CeeOP12mo ago
Response tab always gives me this, no matter what im inspecting
No description
Jamie Cee
Jamie CeeOP12mo ago
Thats all it gives. When I double click on it, the image shows (redirects to the link)
No description
Jamie Cee
Jamie CeeOP12mo ago
How do I avoid that for local development?
Dennis Koch
Dennis Koch12mo ago
Make your site secure Should be easy with Valet or Herd. Not sure what tools you use
Jamie Cee
Jamie CeeOP12mo ago
Neither of them, just a basic docker container
Dennis Koch
Dennis Koch12mo ago
Well, then I can't help 😅
Jamie Cee
Jamie CeeOP12mo ago
No worries haha. Cheers anyway. As long as it would likely work on a live server
Dennis Koch
Dennis Koch12mo ago
Can you share the line with the details on the right closed?
Jamie Cee
Jamie CeeOP12mo ago
No description
Lara Zeus
Lara Zeus12mo ago
Content Security Policy is blocking content I think its nginx config
Jamie Cee
Jamie CeeOP12mo ago
add_header Content-Security-Policy "default-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: cdn.jsdelivr.net;style-src 'self' 'unsafe-inline' fonts.googleapis.com; img-src 'self' data: blob:; font-src *; media-src 'self' blob: data:; object-src 'self'; connect-src * blob: data:; worker-src 'self' blob: data:;";
add_header Content-Security-Policy "default-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: cdn.jsdelivr.net;style-src 'self' 'unsafe-inline' fonts.googleapis.com; img-src 'self' data: blob:; font-src *; media-src 'self' blob: data:; object-src 'self'; connect-src * blob: data:; worker-src 'self' blob: data:;";
Found this line in the nginx config
Lara Zeus
Lara Zeus12mo ago
yes these the allowed domains you can add ui-avatars.com
Jamie Cee
Jamie CeeOP12mo ago
Whats the correct syntax for it (A colleague wrote this config file) just ui-avatars.com. Do I need any of the 'self' stuff?
Lara Zeus
Lara Zeus12mo ago
for testing only change img-src 'self' data: blob: to img-src '*':
Jamie Cee
Jamie CeeOP12mo ago
Nah, didnt change anything
Lara Zeus
Lara Zeus12mo ago
rebuild the container?
Jamie Cee
Jamie CeeOP12mo ago
Yeah, did that
Lara Zeus
Lara Zeus12mo ago
🤔 the add_header Content-Security-Policy is tricky you can ofc commente it out with hash # and test
Jamie Cee
Jamie CeeOP12mo ago
So its no longer red, but blocked by something else
Jamie Cee
Jamie CeeOP12mo ago
No description
Jamie Cee
Jamie CeeOP12mo ago
Assuming, thats this line of the config: add_header Cross-Origin-Opener-Policy "same-origin";
Lara Zeus
Lara Zeus12mo ago
ya that too same-origin to * this is totally not secure approach please dont tell your colleague I told you to use * 😂
Jamie Cee
Jamie CeeOP12mo ago
I shant, its only for testing locally anyway. Config is setup differently for staging/prod servers I believe
DrByte
DrByte12mo ago
🤣
Jamie Cee
Jamie CeeOP12mo ago
Hmm, still same error
Lara Zeus
Lara Zeus12mo ago
add inside the location / add_header Access-Control-Allow-Origin "*";
Jamie Cee
Jamie CeeOP12mo ago
Ah, we're working It was the Cross-Origin-Embedder-Policy: was set to require-corp So now I know it defo works, I can leave it for now. Danke 🙂
Fix
Fix8mo ago
lcoal
Want results from more Discord servers?
Add your server