Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.

Support extension of JSON mimetype#167

Merged
lmazuel merged 2 commits intomasterfrom
json_mime_type
Jul 24, 2019
Merged

Support extension of JSON mimetype#167
lmazuel merged 2 commits intomasterfrom
json_mime_type

Conversation

@lmazuel
Copy link
Member

@lmazuel lmazuel commented Jul 5, 2019

Fix #140

@lmazuel lmazuel requested a review from johanste July 5, 2019 19:26
'text/json' # Because we're open minded people...
]
# Accept "text" because we're open minded people...
JSON_REGEXP = re.compile(r'(application|text)/([a-z+.]+\+)?json')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still won't match content types with parameters:

Example: Content-type: application/json; charset=utf-8

Not blocking the PR for this. Just letting you know...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless the parameters have already been stripped off (which it looks like they may have been at this point)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they have at this point (see a little later in the file).

assert result["success"] is True

# JSON with UTF-8 BOM
response = build_response(b'\xef\xbb\xbf{"success": true}', content_type="application/json; charset=utf-8")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codecov-io
Copy link

codecov-io commented Jul 24, 2019

Codecov Report

Merging #167 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
+ Coverage   87.84%   87.84%   +<.01%     
==========================================
  Files          25       25              
  Lines        2583     2584       +1     
==========================================
+ Hits         2269     2270       +1     
  Misses        314      314
Impacted Files Coverage Δ
msrest/pipeline/universal.py 95.09% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4086bf...852f412. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Response content type json parser

3 participants