diff --git a/httpie/output/formatters/colors.py b/httpie/output/formatters/colors.py index 6ee3964b..2ccd5d9a 100644 --- a/httpie/output/formatters/colors.py +++ b/httpie/output/formatters/colors.py @@ -65,11 +65,11 @@ class ColorFormatter(FormatterPlugin): def get_lexer(mime): mime_types, lexer_names = [mime], [] - type_, subtype = mime.split('/') + type_, subtype = mime.split('/', 1) if '+' not in subtype: lexer_names.append(subtype) else: - subtype_name, subtype_suffix = subtype.split('+') + subtype_name, subtype_suffix = subtype.split('+', 1) lexer_names.extend([subtype_name, subtype_suffix]) mime_types.extend([ '%s/%s' % (type_, subtype_name), diff --git a/tests/test_output.py b/tests/test_output.py index 20ea7b41..6a4ebf41 100644 --- a/tests/test_output.py +++ b/tests/test_output.py @@ -39,6 +39,7 @@ class TestColors: 'foo/bar+json', 'foo/json-foo', 'foo/x-json', + 'application/vnd.comverge.grid+hal+json', ]) def test_get_lexer(self, mime): lexer = get_lexer(mime)