mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Align StaticFileHandler
with Crystal's stdlib enabling Windows support
This commit is contained in:
parent
7c47bbc150
commit
b223199014
1 changed files with 3 additions and 8 deletions
|
@ -27,15 +27,10 @@ module Kemal
|
|||
return
|
||||
end
|
||||
|
||||
expanded_path = File.expand_path(request_path, "/")
|
||||
is_dir_path = if original_path.ends_with?('/') && !expanded_path.ends_with? '/'
|
||||
expanded_path = expanded_path + '/'
|
||||
true
|
||||
else
|
||||
expanded_path.ends_with? '/'
|
||||
end
|
||||
request_path = Path.posix(request_path)
|
||||
expanded_path = request_path.expand("/")
|
||||
|
||||
file_path = File.join(@public_dir, expanded_path)
|
||||
file_path = @public_dir.join(expanded_path.to_kind(Path::Kind.native))
|
||||
is_dir = Dir.exists?(file_path)
|
||||
|
||||
if request_path != expanded_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue