Add optional charset parameter to web.FileResponse - #13151
Conversation
Allows callers to set an explicit charset on the Content-Type header for text-like MIME types (e.g. text/plain, text/html). Fixes aio-libs#4559
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #13151 +/- ##
=======================================
Coverage 98.97% 98.97%
=======================================
Files 131 131
Lines 48824 48856 +32
Branches 2546 2547 +1
=======================================
+ Hits 48324 48356 +32
Misses 376 376
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
@aiolibsbot review |
PR Review — Add optional charset parameter to web.FileResponseClean, well-scoped addition of an optional Strengths:
🟢 Suggestions
1. `charset` silently ignored for non-`text/` text-based media types
|
Yeah, this is what was standing out to me as a bit odd. I'm not sure this is the right design. I'm also wondering about getting the charset automatically.. |
Fixes #4559
Adds an optional
charsetparameter toweb.FileResponseso callers can set an explicit charset on the response content-type.