post 요청시 헤더 관련 에러
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)"
]
}
}
]
}
답변 1
1
안녕하세요! 호정님!
apollo 버전이 올라가면서 발생한 문제인 것 같아요!
아래 링크에 왜 이러한 문제가 발생하였는지에 관한 자세한 설명이 포함되어있습니다!^^
그래프 ql 문서 사용할때 느낌표 남는거 어떻게 없애나요?
0
84
2
강의 전체 소스 코드를 받고싶습니다.
0
76
2
fontawesome 사용 문의
0
79
2
소스 코드 부탁드립니다~
0
85
2
깃 레포지터리 소스
0
85
2
커리큘럼12.css 정렬 에 나오는 과제 정답알고싶어요
0
73
2
10-01 Entity TypeOrmModule.forRoot 에 entities
0
88
3
강의 버전관련 문의입니다
0
103
2
Ubuntu 설치 관련
0
61
1
schema.gql 질문 드립니다.
0
51
1
서버 재실행시 Many to Many
0
102
3
input 관련 문의
0
90
2
Rest API 보다는 graphql이 주된 내용인데
0
131
2
강의 전체 소스코드 받을수있을까요?
0
156
1
도커볼륨 마운트 관련
0
127
2
findOne 타입스크립트오류
0
109
1
http => htrtps 호출 인증서 신뢰 오류
0
353
1
self-signed certificate in certificate chain 에러 발생
0
417
1
mongoose 설치 오류
0
142
1
특정 API, 특정 IP 허용 (단일경로에 CORS 활성화)
0
283
2
08-06
0
180
3
구조랑 패턴 관련해서 질문
0
125
2
mydocker
0
128
2
coolsms statuscode 2000 인데 전송안돼는 경우 확인.
0
156
1





