-
Notifications
You must be signed in to change notification settings - Fork 8
fix: Upgrade 헤더 유무에 따라 Connection 헤더의 값을 동적으로 설정하도록 #581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: Upgrade 헤더 유무에 따라 Connection 헤더의 값을 동적으로 설정하도록 #581
Conversation
- Upgrade 헤더가 존재하면(e.g. WebSocket) upgrade로 설정 - Upgrade 헤더가 존재하지 않으면 keep-alive로 설정
WalkthroughNginx 설정 파일 두 개(개발 및 프로덕션 환경)에 동적 연결 업그레이드 처리를 추가했습니다.
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10분
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sukangpunch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다! 제가 프로토콜에 대해 이해도가 낮아 간단하게 궁금한 내용이 있어서 여쭈어 봅니다.
만약 Connection 헤더가 upgrade 인 상황에선 어떤 문제가 발생하나요?
간단하게 알아 본 결과 요청 및 응답 결과에 대한 문제는 없지만,
- 프로토콜 표준 위반
- 리소스 비효율
- 서버가 프로토콜 전환을 기대하며 대기 할 수 있다.(연결이 길어짐)
- 의미없는 리소스 점유
- 실제로는 일반 http 요청인데 websocket 대기 상태처럼 처리
개선 내용
- 모든 요청에 Connection: upgrade로 가는 상황에서, Upgrade 헤더 기반으로 upgrade, keep-alive 의 값이 들어가게 함
- 즉, websocket 연결이면 upgrade로 프로토콜을 변경하고, http 연결이면 Connection을 keep-alive로 유지하게 한다
이 정도의 문제로 이해하고 있는데 맞는지 궁금합니다!!
서버가 Connection 헤더의 값이
이해하신 것이 맞습니다 🙆♂️ |
sukangpunch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
Gyuhyeok99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오! 이런 건 또 처음알았네요! 공유해주셔서 감사합니다~
관련 이슈
작업 내용
모든 요청에 대해 Connection 헤더의 값이
upgrade로 설정되는 문제가 있었습니다.Upgrade 헤더 유무에 따라 Connection 헤더의 값을 동적으로 설정하도록 수정하였습니다.
특이 사항
AS-IS
WebSocket 핸드셰이크
Upgrade, Upgrade 헤더에websocket을 포함하여 전송한다.Upgrade, Upgrade 헤더에 받은 요청의 Upgrade 헤더 값으로 설정하여 서버로 전송한다.일반 HTTP 요청
keep-alive, Upgrade 헤더는 값을 포함하지 않은 채 전송한다.Upgrade로 설정하고, Upgrade 헤더의 값을null로 설정하여 서버로 전송한다.리뷰 요구사항 (선택)