fix: SSR 내부 fetch getClientAddress() 500 에러 수정#720
Merged
Conversation
ADDRESS_HEADER=x-real-ip 설정 시 SSR 내부 fetch(svelteKitFetch)에는 x-real-ip 헤더가 없어 getClientAddress()가 throw하면서 댓글 API와 파일 API가 500을 반환하던 문제 수정. safeGetClientAddress() 헬퍼를 도입하여 hooks.server.ts의 모든 getClientAddress() 호출을 통일하고, 내부 요청은 rate limiting을 건너뛰도록 처리.
Contributor
Staging 배포 완료URL: https://dev.damoang.net
|
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.
Summary
svelteKitFetch()로 내부 API(/api/boards/.../comments,/api/boards/.../files) 호출 시hooks.server.ts의getClientAddress()가 throw하여 500 에러 발생하던 문제 수정ADDRESS_HEADER=x-real-ip설정 환경에서 내부 fetch에는 해당 헤더가 없어 발생safeGetClientAddress()헬퍼를 도입하여 모든getClientAddress()호출을 통일, 내부 요청은 rate limiting 건너뜀영향 범위
Test plan
kubectl logs에서[Server Error] 500 .../comments없음 확인