Created
October 19, 2011 12:55
-
-
Save jaakkos/1298207 to your computer and use it in GitHub Desktop.
Plaa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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