Skip to content

Instantly share code, notes, and snippets.

@vadimvorotilov
Created December 2, 2014 17:29
Show Gist options
  • Save vadimvorotilov/e8b4fb4111f3d4016a3c to your computer and use it in GitHub Desktop.
Save vadimvorotilov/e8b4fb4111f3d4016a3c to your computer and use it in GitHub Desktop.

Revisions

  1. vadimvorotilov created this gist Dec 2, 2014.
    6 changes: 6 additions & 0 deletions throw-in-rack.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    def last_modified(time)
    response[’Last-Modified’] = time
    if request.env[’HTTP_IF_MODIFIED_SINCE’] > time
    throw :halt, response
    end
    end