Skip to content

Commit

Permalink
use headers["If-Modified-Since"]?
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Jan 6, 2018
1 parent 73c4289 commit 2ff58b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/http/server/handlers/static_file_handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class HTTP::StaticFileHandler
last_modified = File.stat(file_path).mtime
context.response.headers["Last-Modified"] = HTTP.rfc1123_date(last_modified)

if if_modified_since = context.request.headers.fetch("If-Modified-Since", nil)
if if_modified_since = context.request.headers["If-Modified-Since"]?
# TODO: Use a more generalized time format parser for better compatibility to RFC 7232
header_time = Time.parse(if_modified_since, "%a, %d %b %Y %H:%M:%S GMT")

Expand Down

0 comments on commit 2ff58b8

Please sign in to comment.