Closed amcgregor closed 3 years ago
Initial commit, in diff order:
Armours expressive development-time logging from responses that escape without having content_type
defined.
Assigns None
within web.ext.base
during per-request prepare
satisfying the title of this issue.
Updates default views in line with issue description, to correctly interpret None
as undefined, and to assign a default MIME type if another has not already been declared:
None
values are returned as empty text/plain
.str
values are checked against a regular expression (apologies if link is currently non-functional; having some issues with regex101; actual expression used) and if found to be "HTML-like", text/html
is used, otherwise text/plain
.Generator[Union[str,bytes]]
will warn if a content_type
has not been provided and default to text/html
.Additionally, a typo was corrected in the MiniDOM view.
Closing with additional improvements to the ETree view, in determining HTML or XML rendering paths through pre-population of the response content_type
and charset
in c2ba18d and the application of minor type hinting polish in 28812a6. That should wrap up core functionality altered due to this change.
Update the views to detect assignment of a value to prevent overriding of intentional choices.