-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Hi,
Thanks for the library — it's very useful!
I encountered an issue related to parameter encoding. When sending FastCGI requests, the library encodes parameters using ASCII:
File: FastCGIClient.py, function: __encodeNameValueParams, code line: 169
return record + bytearray(str(name).encode('ascii')) + bytearray(str(value).encode('ascii'))This causes a problem when parameters contain non-ASCII characters (e.g., in SCRIPT_FILENAME, QUERY_STRING, or custom headers), resulting in a UnicodeEncodeError.
According to the FastCGI specification and common usage (e.g., PHP-FPM, Nginx), UTF-8 should be used for encoding strings in most environments.
Suggested fix:
Update the encoding line to:
return record + bytearray(str(name).encode('utf-8')) + bytearray(str(value).encode('utf-8'))Let me know if you’d like a pull request — I’d be happy to help!
wuyunfeng
Metadata
Metadata
Assignees
Labels
No labels