[React] HTTP 403 ์ด๋ฏธ์ง€ ๋กœ๋“œ ์—๋Ÿฌ googleusercontent.com
728x90

์–ด๋–ค ์—๋Ÿฌ?

ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๊ฐ€ ์‚ฌ์šฉ๋˜๋Š” ์–ด๋Š ๊ณณ์ด๋˜ ๋‚˜ํƒ€๋‚˜๋˜ ์ด 403 ์—๋Ÿฌ..

ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๋ฅผ ์ œ๋Œ€๋กœ ๋ชป๊ฐ€์ ธ์™€์„œ ๊ทธ๋Ÿฐ ๋“ฏ ๋ณด์˜€๋‹ค.

๊ทธ๋ž˜์„œ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๊ฐ€ ๋นˆ๋ฒˆํ•˜๊ฒŒ ์ œ๋Œ€๋กœ ๋œจ์ง€ ์•Š์•˜๋‹ค.

์ด๋ ‡๊ฒŒ ๋น„์–ด์žˆ๋Š” ์ด๋ฏธ์ง€๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด src๊ฐ€ ๋น„์–ด์žˆ๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

 

 

 

 

 

์›์ธ ํŒŒ์•…

์ด ๋ฌธ์ œ๋Š” ๊ตฌ๊ธ€๋กœ ๋กœ๊ทธ์ธํ•œ ๊ณ„์ •์—๋งŒ ๋‚˜ํƒ€๋‚˜๋Š” ํ˜„์ƒ..

403 ์—๋Ÿฌ๋Š” ์„œ๋ฒ„์— ์š”์ฒญ์„ ํ–ˆ์ง€๋งŒ ๊ถŒํ•œ์ƒ์˜ ๋ฌธ์ œ๋กœ ๊ฑฐ์ ˆ๋˜์—ˆ๋‹ค๋Š” ์—๋Ÿฌ๋ผ๋Š”๋ฐ, ๋ณดํ†ต ๋‹ค๋ฅธ ๋„๋ฉ”์ธ์—์„œ ํ˜ธ์ถœํ•  ๋•Œ ๋ฐœ์ƒํ•œ๋‹ค๊ณ  ํ•œ๋‹ค.
๋‹ค๋ฅธ ๋„๋ฉ”์ธ์—์„œ ์˜จ ์š”์ฒญ์ž„์„ ํ™•์ธํ•˜๊ณ  ๊ฑฐ์ ˆํ–ˆ๋‹จ ๊ฒƒ์ด๋‹ค.

 

 

 

 

ํ•ด๊ฒฐ ๊ณผ์ •

https://stackoverflow.com/questions/56242788/http-403-on-images-loaded-from-googleusercontent-com

 

HTTP 403 on images loaded from googleusercontent.com

First off, I don't think my problem is related to these questions: question 1, or question 2. Because I'm not using authentication anywhere, or any library either (I don't need to). I'm simply loa...

stackoverflow.com

 

 

์Šคํƒ ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ์—์„œ ๊ฐ™์€ ์˜ค๋ฅ˜์˜ ๋‹ต๋ณ€์„ ์ฐพ์„ ์ˆ˜ ์žˆ์—ˆ๋‹ค.

์ด๋ฏธ์ง€ ํƒœ๊ทธ์— referrerPolicy="no-referrer"๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ์–ด ํ•ด๊ฒฐํ–ˆ๋‹ค.

 

์™ธ๋ถ€ ๋งํฌ ๊ณต์œ  ๊ธˆ์ง€๊ฐ€ ์ ์šฉ๋œ ์ด๋ฏธ์ง€๋ฅผ no-referrer ์„ค์ •์„ ํ†ตํ•ด์„œ ๋ณด์—ฌ์ค€๋‹ค.

 

   <ProfileImage
          src={
            profileImg === '' || profileImg === undefined
              ? defaultProfile
              : profileImg
          }
          alt="ํ”„๋กœํ•„์ด๋ฏธ์ง€"
          referrerPolicy="no-referrer"
    />

 

 

ํ•ด๊ฒฐํ•˜๊ณ  ๋ณด๋‹ˆ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๋ฅผ ํ•œ ๋ฒˆ์ด๋ผ๋„ ์ˆ˜์ •ํ•œ ๊ฒฝ์šฐ๊ฐ€ ์—†๋‹ค๋ฉด ๊ตฌ๊ธ€ ๊ณ„์ • ๊ฐ™์€ ๊ฒฝ์šฐ ์š”์ฒญํ—ค๋” ์ฃผ์ฒด๊ฐ€ ๋‹ฌ๋ž๋‹ค. (๋‹น์—ฐํ•˜๊ฒ ์ง€๋งŒ ๐Ÿ‘€)

728x90