Skip to content

Instantly share code, notes, and snippets.

@jaakkos
Created October 19, 2011 12:55
Show Gist options
  • Save jaakkos/1298207 to your computer and use it in GitHub Desktop.
Save jaakkos/1298207 to your computer and use it in GitHub Desktop.
Plaa
# Origin of etag_matches? https://github.com/rails/rails/blob/7511f9794df8f803f28306d378f9fefc28165886/actionpack/lib/action_dispatch/http/cache.rb
module ActionController
class Request
alias_method :etag_matches_original?, :etag_matches?
def etag_matches?(etag)
!env['HTTP_USER_AGENT'].include?('MSIE') && etag_matches_original?(etag)
end
end
class Response
alias_method :etag_original?, :etag?
def etag?
request.env['HTTP_USER_AGENT'].include?('MSIE') || etag_original?
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment