fix: presignedUrl에서 R2 exists() 체크 제거

- exists()가 매 요청마다 R2 HTTP HEAD 호출 → 개발서버에서 지연/500 발생
- temporaryUrl()은 로컬 서명 생성만 하므로 R2 접근 불필요
- 파일 미존재 시 브라우저가 R2에서 직접 404 수신

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 09:17:53 +09:00
parent 844a0458ad
commit 9bdb81d8ff

View File

@@ -133,8 +133,8 @@ public function presignedUrl(int $id, Request $request)
$service = new FileStorageService;
$file = $service->getFile($id);
if (! $file->file_path || ! Storage::disk('r2')->exists($file->file_path)) {
abort(404, 'File not found in storage');
if (! $file->file_path) {
abort(404, 'File not found');
}
$url = Storage::disk('r2')->temporaryUrl(