Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the wrong Content-Length in python-server.py for non-ascii characters. #24480

Merged

Commits on Nov 26, 2024

  1. Fix the wrong Content-Length in python-server.py for non-ascii charac…

    …ters.
    
    Content-Length is the data in bytes, not len of str. We should use sys.stdin.buffer.read instead of sys.stdin.read to receive bytes.
    
    _send_message should calculate "Content-Length" from bytes, not str.
    tomoki authored and karthiknadig committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    b190169 View commit details
    Browse the repository at this point in the history
  2. Use stdin.buffer in get_headers()

    We should use stdin.buffer.readline instead of stdin.readline because stdin.read* and stdin.buffer.read* should be used at the same time.  (stdin.read* refers the internal buffer)
    tomoki authored and karthiknadig committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    1c8e5f4 View commit details
    Browse the repository at this point in the history