class Troy::Server
def render(status, content_type, path)
def render(status, content_type, path) last_modified = path.mtime.httpdate if request.env["HTTP_IF_MODIFIED_SINCE"] == last_modified return [304, {}, []] end headers = { "Content-Type" => content_type, "Last-Modified" => last_modified } content = request.head? ? [] : [path.read] [status, headers, content] end