Skip to content

Commit

Permalink
Merge pull request #95 from 2xyo/media-type
Browse files Browse the repository at this point in the history
Remove the extra space in the Content-Type
  • Loading branch information
emmanvg authored Feb 11, 2021
2 parents 3ee5574 + bb8cc6a commit 16a0f31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion taxii2client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
DEFAULT_USER_AGENT = "taxii2-client/2.2.2"
MEDIA_TYPE_STIX_V20 = "application/vnd.oasis.stix+json; version=2.0"
MEDIA_TYPE_TAXII_V20 = "application/vnd.oasis.taxii+json; version=2.0"
MEDIA_TYPE_TAXII_V21 = "application/taxii+json; version=2.1"
MEDIA_TYPE_TAXII_V21 = "application/taxii+json;version=2.1"

from .v21 import * # This import will always be the latest TAXII 2.X version
from .version import __version__
6 changes: 3 additions & 3 deletions taxii2client/test/test_client_v21.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def test_content_type_invalid(collection):
with pytest.raises(TAXIIServiceException) as excinfo:
collection.get_object("indicator--252c7c11-daf2-42bd-843b-be65edca9f61")
assert ("Unexpected Response. Got Content-Type: 'taxii' for "
"Accept: 'application/taxii+json; version=2.1'") in str(excinfo.value)
"Accept: 'application/taxii+json;version=2.1'") in str(excinfo.value)


def test_url_filter_type():
Expand Down Expand Up @@ -782,8 +782,8 @@ def test_invalid_content_type_for_connection():
conn.get("https://example.com/api1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/",
headers={"Accept": MEDIA_TYPE_TAXII_V21 + "; charset=utf-8"})

assert ("Unexpected Response. Got Content-Type: 'application/taxii+json; "
"version=2.1' for Accept: 'application/taxii+json; version=2.1; "
assert ("Unexpected Response. Got Content-Type: 'application/taxii+json;"
"version=2.1' for Accept: 'application/taxii+json;version=2.1; "
"charset=utf-8'") in str(excinfo.value)


Expand Down

0 comments on commit 16a0f31

Please sign in to comment.