Browse Source

Made charset optional in the content-type header for plaintext. The verification will now accept the correct content type regardless of whether or not charset is included

Steven Smith 9 years ago
parent
commit
a3e0d27df3
1 changed files with 7 additions and 1 deletions
  1. 7 1
      toolset/benchmark/test_types/verifications.py

+ 7 - 1
toolset/benchmark/test_types/verifications.py

@@ -82,7 +82,7 @@ def verify_headers(headers, url, should_be='json'):
                      'Unexpected content encoding, found \"%s\", expected \"%s\".' % (
                          content_type, expected_type),
                      url))
-        else:
+        elif expected_type == types['json']:
             if content_type == includes_charset:
                 problems.append(
                     ('warn',
@@ -96,6 +96,12 @@ def verify_headers(headers, url, should_be='json'):
                      'Unexpected content encoding, found \"%s\", expected \"%s\"' % (
                          content_type, expected_type),
                      url))
+        elif content_type != expected_type and content_type != includes_charset:
+            problems.append(
+                ('warn',
+                 'Unexpected content encoding, found \"%s\", expected \"%s\"' % (
+                     content_type, expected_type),
+                 url))
     return problems