fix: sort 파라미터 없는 요청에서 발생하던 500 에러 수정 - #229
Merged
Merged
Conversation
GET /api/public-course를 쿼리 파라미터 없이(예: 그냥 /api/public-course) 호출하면
HttpServletRequest.getQueryString()이 null을 반환하는데, SortStatusIdResolver가
이를 null 체크 없이 split()하다가 NPE(500)로 이어지던 버그를 수정했다. sort 키가
없는 경우와 동일하게 기본값("date")으로 처리하도록 했다.
unam98
requested review from
RinRinPARK,
YuSuhwa-ve and
funnysunny08
as code owners
August 6, 2026 06:38
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
작업 배경
GET /api/public-course를 쿼리 파라미터 없이 호출하면(흔한 실제 클라이언트 호출 패턴) 500이 발생하는 버그.변경 사항
common/resolver/sort/SortStatusIdResolver.javarequest.getQueryString()이 null일 때(쿼리 파라미터가 전혀 없을 때) NPE로 500이 나던 버그 수정영향 범위
GET /api/public-course(퍼블릭 코스 추천/메인 피드 엔드포인트)를 쿼리 파라미터 없이 호출하면HttpServletRequest.getQueryString()이 null을 반환해SortStatusIdResolver가null.split()으로 NPE → 500을 반환하던 버그. sort 키만 없는 경우(예:?pageNo=1)는 이미 정상 처리되고 있었다.Test Plan
./gradlew compileJava)./gradlew test전체 통과 확인🤖 Generated with Claude Code