inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

13-01 Single Image Upload

post 요청시 헤더 관련 에러

해결된 질문

541

박호정

작성한 질문수 43

1

 post 요청시 헤더 관련 아래 에러 발생하는데, apollo-require-preflight: true등을 넣으면 정상 작동 하네요. 혹시 이 에러가 강의 중에는 안 나던데, 이유 알 수 있을까요?

 

{
    "errors": [
        {
            "message": "This operation has been blocked as a potential Cross-Site Request Forgery (CSRF). Please either specify a 'content-type' header (with a type that is not one of application/x-www-form-urlencoded, multipart/form-data, text/plain) or provide a non-empty value for one of the following headers: x-apollo-operation-name, apollo-require-preflight\n",
            "extensions": {
                "code": "BAD_REQUEST",
                "stacktrace": [
                    "BadRequestError: This operation has been blocked as a potential Cross-Site Request Forgery (CSRF). Please either specify a 'content-type' header (with a type that is not one of application/x-www-form-urlencoded, multipart/form-data, text/plain) or provide a non-empty value for one of the following headers: x-apollo-operation-name, apollo-require-preflight",
                    "",
                    "    at new GraphQLErrorWithCode (/Users/hojeongpark/Develop/study/backend-bootcamp/class/section13/13-01-single-image-upload/node_modules/@apollo/server/src/internalErrorClasses.ts:15:5)",
                    "    at new BadRequestError (/Users/hojeongpark/Develop/study/backend-bootcamp/class/section13/13-01-single-image-upload/node_modules/@apollo/server/src/internalErrorClasses.ts:116:5)",
                    "    at preventCsrf (/Users/hojeongpark/Develop/study/backend-bootcamp/class/section13/13-01-single-image-upload/node_modules/@apollo/server/src/preventCsrf.ts:91:9)",
                    "    at ApolloServer.executeHTTPGraphQLRequest (/Users/hojeongpark/Develop/study/backend-bootcamp/class/section13/13-01-single-image-upload/node_modules/@apollo/server/src/ApolloServer.ts:1047:20)",
                    "    at processTicksAndRejections (node:internal/process/task_queues:95:5)"
                ]
            }
        }
    ]
}

javascript node.js express docker tdd rest-api nestjs

답변 1

1

노원두

안녕하세요! 호정님!

apollo 버전이 올라가면서 발생한 문제인 것 같아요!

아래 링크에 왜 이러한 문제가 발생하였는지에 관한 자세한 설명이 포함되어있습니다!^^

https://www.inflearn.com/questions/840954

윈도우에서 Node js를 설치하고 싶어요

0

5

0

그래프 ql 문서 사용할때 느낌표 남는거 어떻게 없애나요?

0

102

2

강의 전체 소스 코드를 받고싶습니다.

0

92

2

fontawesome 사용 문의

0

96

2

소스 코드 부탁드립니다~

0

99

2

깃 레포지터리 소스

0

96

2

커리큘럼12.css 정렬 에 나오는 과제 정답알고싶어요

0

81

2

10-01 Entity TypeOrmModule.forRoot 에 entities

0

101

3

강의 버전관련 문의입니다

0

111

2

Ubuntu 설치 관련

0

73

1

schema.gql 질문 드립니다.

0

63

1

서버 재실행시 Many to Many

0

119

3

input 관련 문의

0

97

2

Rest API 보다는 graphql이 주된 내용인데

0

145

2

강의 전체 소스코드 받을수있을까요?

0

170

1

도커볼륨 마운트 관련

0

135

2

findOne 타입스크립트오류

0

116

1

http => htrtps 호출 인증서 신뢰 오류

0

374

1

self-signed certificate in certificate chain 에러 발생

0

439

1

mongoose 설치 오류

0

149

1

특정 API, 특정 IP 허용 (단일경로에 CORS 활성화)

0

300

2

08-06

0

187

3

구조랑 패턴 관련해서 질문

0

134

2

mydocker

0

135

2