diff --git a/rest_framework/templatetags/rest_framework.py b/rest_framework/templatetags/rest_framework.py
index ccd9430b4e..22f6f64e83 100644
--- a/rest_framework/templatetags/rest_framework.py
+++ b/rest_framework/templatetags/rest_framework.py
@@ -318,5 +318,5 @@ def break_long_headers(header):
when possible (are comma separated)
"""
if len(header) > 160 and ',' in header:
- header = mark_safe('
' + ',
'.join(header.split(',')))
+ header = mark_safe('
' + ',
'.join(escape(header).split(',')))
return header