Skip to content

Commit 2fdc889

Browse files
tohojostephenfin
authored andcommitted
views/patch: Set correct encoding for patches
The patch_mbox view returns text/plain data without specifying a character set, which means clients will assume the default of iso-8559-1 as defined in the HTTP/1.1 standard. Since the data being returned is in fact utf-8 encoded, set the encoding accordingly in the HTTP Content-Type header. Reported-by: Jakub Kicinski <[email protected]> Suggested-by: Konstantin Ryabitsev <[email protected]> Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
1 parent e1cd856 commit 2fdc889

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patchwork/views/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def patch_mbox(request, project_id, msgid):
154154
patch = get_object_or_404(Patch, project_id=project.id, msgid=db_msgid)
155155
series_id = request.GET.get('series')
156156

157-
response = HttpResponse(content_type='text/plain')
157+
response = HttpResponse(content_type='text/plain; charset=utf-8')
158158
if series_id:
159159
if not patch.series:
160160
raise Http404('Patch does not have an associated series. This is '

0 commit comments

Comments
 (0)