Skip to content

Reject local-only outbound close codes#200

Open
ShipItAndPray wants to merge 1 commit intopython-hyper:mainfrom
ShipItAndPray:fix-182-local-close-codes
Open

Reject local-only outbound close codes#200
ShipItAndPray wants to merge 1 commit intopython-hyper:mainfrom
ShipItAndPray:fix-182-local-close-codes

Conversation

@ShipItAndPray
Copy link
Copy Markdown

Summary

  • raise LocalProtocolError for outbound local-only close codes like 1006 and 1015
  • keep 1005 as the existing sentinel for sending an empty close frame, and handle raw integer 1005 consistently
  • add focused regression coverage at both the frame protocol and connection layers

Validation

  • baseline behavior on parent commit rewrote 1006/1015 to 1000
  • PYTHONPATH=/Users/somepalli/codex/oss-prs-next/wsproto-baseline/src .venv/bin/python -m pytest /tmp/test_wsproto_issue_182.py -q
  • PYTHONPATH=/Users/somepalli/codex/oss-prs-next/wsproto/src .venv/bin/python -m pytest /tmp/test_wsproto_issue_182.py -q
  • .venv/bin/python -m pytest tests/test_frame_protocol.py -k "local_only_close_reason or no_status_rcvd_close_reason" -q
  • .venv/bin/python -m pytest tests/test_connection.py -k "local_only_close_reason_rejected or close_whilst_closing or send_after_close or closure" -q
  • .venv/bin/python -m pytest -q

Closes #182.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attempt to close with local-only codes (e.g. 1006) results in normal close (1000)

2 participants