nodejs-book
nodejs-book copied to clipboard
16장 CSP(content security policy)
안녕하세요 16장에 구글 storage와 연결해서 사용할려고하는데 Content Security Policy 때문에 미리보기가 안되네요 ㅠㅠ 어떻게해야하죠?
<meta http-equiv="Content-Security-Policy" content="img-src https://storage.googleapis.com 'self' data: https:">
메타테그를 이렇게 넣는데되 안되네요 ㅠㅠ 도와주세요..
helmet이 4.0으로 업데이트돼서 그런 것 같습니다
app.use(helmet())
을
app.use(helmet({ contentSecurityPolicy: false }))
로 helmet 코드를 수정해주세요.
감사합니다 아 그리고
16장에 Google Cloud Function 만드는데 계속 function.js doesn't exist뜨는데 어떻게 하죠? ㅠㅠ
cloud functions 만들 때 어떻게 만드셨는지 화면을 캡쳐해서 올려주세요. function.js라는 단어를 쓰셨나요?
아니요~! 그 선생님이 깃하즈에있는 16.5에 gcp-upload에 index.js package.json파일을 npm i 해서 zip으로 압축해서 올렸는습니다 ! 노드버전은 12버전으로 했고요 resizeAndUpload 함수로 등록했습니다
2020년 9월 5일 (토) 오후 3:16, Hyunyoung Cho [email protected]님이 작성:
cloud functions 만들 때 어떻게 만드셨는지 화면을 캡쳐해서 올려주세요. function.js라는 단어를 쓰셨나요?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeroCho/nodejs-book/issues/118#issuecomment-687559072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCHFUOMJZ2ADWNIH424EQLSEHJUNANCNFSM4QWYE3BA .
혹시 cloud functions가 아니라 firebase functions에 잘못 올리신 적이 있으신가요? 기존 functions를 지우고 다시 함수를 생성하고 zip을 업로드해보세요.
helmet 5버전에서는 다음과 같이 해야 외부 이미지, 아이프레임 등이 제대로 표시됩니다. app.use( helmet({ contentSecurityPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false }), );