Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the extra space in the Content-Type #95

Merged
merged 1 commit into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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