Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A small bug fix in the Serve Router to catch an edge case of a path

issue that can have case mismatches. Made it case-insensitive.
  • Loading branch information...
commit f367e7ed82d1636e944406fb82f7a81ddffbdb4f 1 parent b47605b
@revans revans authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/serve/router.rb
  2. +1 −1  spec/router_spec.rb
View
2  lib/serve/router.rb
@@ -27,7 +27,7 @@ def self.resolve(root, path)
# Still no luck? Check to see if a file with an extension exists by that name.
# TODO: Return a path with an extension based on priority, not just the first found.
result = Dir.glob(full_path + ".*", File::FNM_CASEFOLD).first
- result.sub(/^#{root}/, '').sub(/^\//, '') if result && File.file?(result)
+ result.sub(/^#{root}/i, '').sub(/^\//, '') if result && File.file?(result)
end
end
View
2  spec/router_spec.rb
@@ -57,4 +57,4 @@ def resolve(name)
Serve::Router.resolve(@root, name)
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.