Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3Rabbit committed Mar 16, 2024
1 parent 077f2af commit a248422
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/http_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def rate_csp(result_dict, _, _local, org_domain, org_www_domain, domain, create_

text_recommendation = ['##### Want to improve your Content-Security-Policy game?\r\n',
'Why not try the below Content-Security-Policy response header to get started using Content Security Policy?\r\n',
'Remember, below recommendation is only based on a sample (read: {0} page) of all pages on your website\r\n'.format(nof_pages),
'Remember, below recommendation is only based on a sample (read: {0} page(s)) of all pages on your website\r\n'.format(nof_pages),
'and based without clicking on anything.\r\n',
'\r\n',
'Recommended Content-Security-Policy policies:\r\n',
Expand Down
6 changes: 4 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,11 @@ def httpRequestGetContent(url, allow_redirects=False, use_text_instead_of_conten
def get_content_type(url, cache_time_delta):
headers = get_url_headers(url, cache_time_delta)

has_content_type_header = 'Content-Type' in headers
if has_content_type_header:
if 'Content-Type' in headers:
return headers['Content-Type']
if 'content-type' in headers:
return headers['content-type']

return None

def get_url_headers(url, cache_time_delta):
Expand Down

0 comments on commit a248422

Please sign in to comment.