Skip to content

Commit 6355e00

Browse files
committed
Ensure path is actually a file in direct filesystem access
1 parent a732b5a commit 6355e00

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

shard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: rucksack
2-
version: 1.0.2
2+
version: 1.0.3
33
description: Attach static files to your compiled crystal binary and access them at runtime.
44

55
authors:

src/rucksack.cr

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class Rucksack
114114
return @@index[path] if @@index.has_key?(path)
115115

116116
raise FileNotFound.new("'#{path}' not found in Rucksack") unless MODE == 0
117-
raise FileNotFound.new("'#{path}' not found in Rucksack nor in filesystem") unless ::File.readable?(path)
117+
raise FileNotFound.new("'#{path}' not found in Rucksack nor in filesystem") unless ::File.readable?(path) && ::File.file?(path)
118118

119119
FilesystemFile.new(path)
120120
end

0 commit comments

Comments
 (0)