Compare commits
2 Commits
3c32614d1c
...
a3d74c0b57
| Author | SHA1 | Date | |
|---|---|---|---|
| a3d74c0b57 | |||
| 9016a72046 |
@@ -59,7 +59,12 @@ class ChargeController(
|
||||
@RequestBody request: PayverseWebhookRequest,
|
||||
servletRequest: HttpServletRequest
|
||||
): PayverseWebhookResponse {
|
||||
val remoteIp = servletRequest.remoteAddr ?: ""
|
||||
val header = servletRequest.getHeader("X-Forwarded-For")
|
||||
val remoteIp = if (header.isNullOrEmpty()) {
|
||||
servletRequest.remoteAddr
|
||||
} else {
|
||||
header.split(",")[0].trim() // 첫 번째 값이 클라이언트 IP
|
||||
}
|
||||
|
||||
print("Payverse Webhook Request: $remoteIp")
|
||||
print("Payverse Webhook Request: $payverseInboundIp")
|
||||
|
||||
@@ -3,7 +3,6 @@ package kr.co.vividnext.sodalive.common
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.dao.DataIntegrityViolationException
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.security.access.AccessDeniedException
|
||||
import org.springframework.security.authentication.BadCredentialsException
|
||||
import org.springframework.security.authentication.InternalAuthenticationServiceException
|
||||
@@ -26,13 +25,6 @@ class SodaExceptionHandler {
|
||||
)
|
||||
}
|
||||
|
||||
// ResponseStatusException은 ApiResponse로 래핑하지 않고 그대로 전달
|
||||
@ExceptionHandler(ResponseStatusException::class)
|
||||
fun handleResponseStatusException(e: ResponseStatusException): ResponseEntity<Void> {
|
||||
// 별도 바디 없이 상태코드만 반환하여 기본 예외 형태를 유지
|
||||
return ResponseEntity.status(e.status).build()
|
||||
}
|
||||
|
||||
@ExceptionHandler(MaxUploadSizeExceededException::class)
|
||||
fun handleMaxUploadSizeExceededException(e: MaxUploadSizeExceededException) = run {
|
||||
logger.error("API error", e)
|
||||
@@ -72,6 +64,7 @@ class SodaExceptionHandler {
|
||||
|
||||
@ExceptionHandler(Exception::class)
|
||||
fun handleException(e: Exception) = run {
|
||||
if (e is ResponseStatusException) throw e
|
||||
logger.error("API error", e)
|
||||
ApiResponse.error("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
server:
|
||||
shutdown: graceful
|
||||
env: ${SERVER_ENV}
|
||||
forward-headers-strategy: framework
|
||||
|
||||
logging:
|
||||
level:
|
||||
|
||||
Reference in New Issue
Block a user