Skip to content

Commit

Permalink
be DRY by referencing own methods
Browse files Browse the repository at this point in the history
  • Loading branch information
konklone committed Dec 3, 2014
1 parent 5630c3a commit 37b860e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/site-inspector/headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ class SiteInspector

# the ? versions could maybe just be dropped
def has_cookies?
!!header_from("Set-Cookie")
!!has_cookies
end

def strict_transport_security?
!!header_from("Strict-Transport-Security")
!!strict_transport_security
end

def content_security_policy?
!!header_from("Content-Security-Policy")
!!content_security_policy
end

def click_jacking_protection?
!!header_from("X-Frame-Options")
!!click_jacking_protection
end

# return the found header value
Expand Down Expand Up @@ -45,7 +45,7 @@ def xss_protection

# more specific checks than presence of headers
def xss_protection?
header_from("X-XSS-Protection") == "1; mode=block"
xss_protection == "1; mode=block"
end

def secure_cookies?
Expand Down

0 comments on commit 37b860e

Please sign in to comment.