TAXIIProject / django-taxii-services

Installable taxii_services
http://taxiiproject.github.io/
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

Bool treated as object: inbox_client fails #21

Closed guidovranken closed 9 years ago

guidovranken commented 9 years ago

in taxii-services/models.py, there are two definitions for functions named is_content_supported(). One of these (class DataCollection) returns an instance of SupportInfo while the other one (class InboxService) returns a bool (True/False).

in taxii-services/taxii_handlers.py, InboxMessage11Handler.handle_message() attempts to treat the value returned by InboxService.is_content_supported() as a SupportInfo object while it is in fact a bool.

This causes an error when running the inbox_client program, and may cause other errors in the future.

The solution is to either make InboxService.is_content_supported() return a SupportInfo object, or make InboxMessage11Handler.handle_message() treat the return value as a bool (which it currently is).

References:

https://github.com/TAXIIProject/django-taxii-services/blob/master/taxii_services/models.py#L1093 https://github.com/TAXIIProject/django-taxii-services/blob/master/taxii_services/taxii_handlers.py#L142 https://github.com/TAXIIProject/django-taxii-services/blob/master/taxii_services/taxii_handlers.py#L150

MarkDavidson commented 9 years ago

Fixed in commit f896294830e7990be7cb4b1efee3efa22a9c1050

Edit: Fixed by making is_content_supported return a SupportInfo object.