chakra-ui icon indicating copy to clipboard operation
chakra-ui copied to clipboard

referrerPolicy not work in NextJS (<Avatar/>)

Open nasatome opened this issue 1 year ago • 4 comments

Description

When I want to use the referer policy in NextJS, it is implemented inside a <span> tag (In the Avatar component)

Link to Reproduction

https://codesandbox.io/s/dazzling-thunder-v5ucno

Steps to reproduce

1.- Inspect the Avatar generated html expected result: image

Obtained: image

Chakra UI Version

2.2.4

Browser

Chromium v101

Operating System

  • [ ] macOS
  • [ ] Windows
  • [X] Linux

Additional Information

Related: https://github.com/chakra-ui/chakra-ui/issues/5909

nasatome avatar Jul 14 '22 20:07 nasatome

I've been struggling with this too. It looks like the referrer-policy doesn't actually get passed through to useImage (see here), which loads the image in the background and then swaps the element over. The initial load fails because it's missing the param.

I assume your expected result is referrerPolicy="no-referrer", not no-referrer="no-referrer".

(Pinging @jaqas because he took care of #6057 😄)

wub avatar Jul 19 '22 02:07 wub

I assume your expected result is referrerPolicy="no-referrer", not no-referrer="no-referrer".

That's right, I had a problem copying and pasting, sorry.

nasatome avatar Jul 21 '22 21:07 nasatome

Having the same problem ;/

nogenem avatar Aug 13 '22 17:08 nogenem

you can use https://nextjs.org/docs/advanced-features/security-headers

ItamarShDev avatar Aug 26 '22 22:08 ItamarShDev

This has already been fixed in one of the recent PRs. We'll release an update shortly.

If the issue persists after the release, I'll re-open this issue.

segunadebayo avatar Apr 24 '23 21:04 segunadebayo