Skip to content

Conversation

@brownsugar-bobamilktea
Copy link
Contributor

Github's raw content uses text/plain for some reason, even if it's a json file; so we use None to suppress MIME content validation by aiohttp.

selected_field = field.value # field is mandatory here
initial_value = await _fetch_entry_with_json(
interaction, selected_entry_id, selected_lang, selected_field, fromI18n=True
interaction, selected_entry_id, selected_lang, selected_field, fromI18n=True, expected_content_type=None
Copy link
Member

Choose a reason for hiding this comment

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

Why None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

suppress MIME content validation by aiohttp, otherwise it raises aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brownsugar-bobamilktea brownsugar-bobamilktea merged commit b43c196 into main Jan 17, 2025
1 check passed
@brownsugar-bobamilktea brownsugar-bobamilktea deleted the fix-editing branch January 17, 2025 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants