Skip to content

Commit 30eb4c3

Browse files
author
FreedomKnight
committed
吐出 304 還是要補上 etag 才能讓 file api 判斷是否該撈取新的圖片
1 parent 6156bd6 commit 30eb4c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/FileEntry.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ public function response($filename)
7272
->setPublic();
7373
}
7474

75-
return response(null, 304)->setPublic();
75+
return response(null, 304)
76+
->setEtag($etag)
77+
->setLastModified(new \DateTime($time))
78+
->setExpires(new \DateTime($expires))
79+
->setPublic();
7680
} catch (FileNotFoundException $e) {
7781
abort(404);
7882
} catch (\Illuminate\Contracts\Filesystem\FileNotFoundException $e) {

0 commit comments

Comments
 (0)