Skip to content

HTTP content-type isn't using charset #689

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

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 8 additions & 2 deletions openapi_core/unmarshalling/response/unmarshallers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ def _unmarshal(
except ResponseFinderError as exc:
return ResponseUnmarshalResult(errors=[exc])

# Drop optional "; charset=utf-8"
mimetype = response.mimetype.split(';')[0]

try:
validated_data = self._get_data(
response.data, response.mimetype, operation_response
response.data, mimetype, operation_response
)
except DataValidationError as exc:
validated_data = None
Expand Down Expand Up @@ -103,9 +106,12 @@ def _unmarshal_data(
except ResponseFinderError as exc:
return ResponseUnmarshalResult(errors=[exc])

# Drop optional "; charset=utf-8"
mimetype = response.mimetype.split(';')[0]

try:
validated = self._get_data(
response.data, response.mimetype, operation_response
response.data, mimetype, operation_response
)
except DataValidationError as exc:
validated = None
Expand Down