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

Skip to content

Commit b1c7a17

Browse files
committed
fix for a bug reported by [email protected] (UnicodeEncodeError..self.sock.sendall(str))
1 parent b98cbee commit b1c7a17

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

extra/keepalive/keepalive.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
"""
7272
from httplib import _CS_REQ_STARTED, _CS_REQ_SENT, _CS_IDLE, CannotSendHeader
7373

74+
from lib.core.common import unicodeToSafeHTMLValue
75+
7476
import threading
7577
import urllib2
7678
import httplib
@@ -323,6 +325,9 @@ def endheaders(self):
323325
else:
324326
raise CannotSendHeader()
325327

328+
for header in self._headers:
329+
self._headers[header] = unicodeToSafeHTMLValue(self._headers[header])
330+
326331
for header in ['Host', 'Accept-Encoding']:
327332
if header in self._headers:
328333
str = '%s: %s' % (header, self._headers[header])

0 commit comments

Comments
 (0)