Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jennifer-richards
Copy link
Member

@jennifer-richards jennifer-richards commented Jul 10, 2025

The first commit fixes an observed bug with the iesg agenda_package.txt view, along with similar iesg views, by setting charset for the content type.

The second commit adjusts every place where we return an HTTP response with content_type="text/plain" to set the charset as well. Most of these could be left alone - the default is US-ASCII, and most of them are simple fixed US-ASCII strings - but it seemed reasonable to me to speak utf-8 everywhere.

Django will apply the encoding specified in the content_type to strings when it builds its response, so unless we're handling responses that include non-UTF-8 bytes or strings encoding characters UTF-8 can't represent, this should be safe. I didn't notice any of those, but it'd be good to check that.

Fixes #8968

@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.73%. Comparing base (f380b1a) to head (0fbc8f8).
Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
ietf/doc/views_ballot.py 50.00% 1 Missing ⚠️
ietf/meeting/views.py 93.75% 1 Missing ⚠️
ietf/submit/views.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9120      +/-   ##
==========================================
- Coverage   88.74%   88.73%   -0.02%     
==========================================
  Files         321      320       -1     
  Lines       41853    41656     -197     
==========================================
- Hits        37144    36962     -182     
+ Misses       4709     4694      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

rjsparks
rjsparks previously approved these changes Jul 24, 2025
# Conflicts:
#	ietf/api/views.py
@rjsparks rjsparks merged commit 328ee12 into ietf-tools:main Jul 24, 2025
10 checks passed
@jennifer-richards jennifer-richards deleted the response-charsets branch July 24, 2025 13:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2025
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.

review views that return an explicitly constructed HttpResponse of type text/plain for whether they're using/declaring the appropriate encoding

2 participants