Compare commits

..
1 Commits
Author SHA1 Message Date
headporterandClaude Opus 5.5 25f583608d fix : 봇 오류를 502 대신 500으로 (Worker가 502를 '서버 쉬는 중'으로 바꿔 버림)
SpecialSource Backend CI/CD / build-and-deploy (push) Successful in 55s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 09:53:53 +09:00
@@ -121,12 +121,13 @@ public class MediaPostController {
} catch (RestClientResponseException e) {
repository.delete(post);
// 봇의 {"error": "..."} 를 그대로 전달 (예: 지원하지 않는 링크)
return ResponseEntity.status(e.getStatusCode().is4xxClientError() ? 400 : 502)
// ※ 502~504 금지: Cloudflare Worker가 "NAS 꺼짐"으로 보고 "서버가 쉬는 중" 화면으로 바꿔 버림 → 500
return ResponseEntity.status(e.getStatusCode().is4xxClientError() ? 400 : 500)
.contentType(MediaType.APPLICATION_JSON)
.body(e.getResponseBodyAsString());
} catch (RestClientException e) {
repository.delete(post);
return ResponseEntity.status(502).body(Map.of("error", "다운로드 봇에 연결할 수 없습니다"));
return ResponseEntity.status(500).body(Map.of("error", "다운로드 봇에 연결할 수 없습니다")); // 502 금지 (위 참고)
}
return ResponseEntity.ok(toResponse(post, false));
}