Header names are case insensitive

Move header checks to web_site
This commit is contained in:
Christian Mehlmauer
2013-08-10 11:49:30 +02:00
parent 6c008015e9
commit 5ea911c9b3
6 changed files with 20 additions and 16 deletions

View File

@@ -1,40 +0,0 @@
# encoding: UTF-8
class WpTarget < WebSite
module InterestingHeaders
# Checks for interesting headers
# @return [ Array ] Interesting Headers
def interesting_headers
response = Browser.head(@uri.to_s)
headers = response.headers
InterestingHeaders.known_headers.each do |h|
headers.delete(h)
end
headers.to_a.compact.sort
end
protected
# @return [ Array ]
def self.known_headers
%w{
Location
Date
Content-Type
Content-Length
Connection
Etag
ETag
Expires
Last-Modified
Pragma
Vary
Cache-Control
X-Pingback
Accept-Ranges
}
end
end
end