Skip to content

Preserve quoted parameter values when parsing and serializing - #8

Open
OskarEichler wants to merge 1 commit into
faye:mainfrom
OskarEichler:codex/preserve-quoted-values
Open

Preserve quoted parameter values when parsing and serializing#8
OskarEichler wants to merge 1 commit into
faye:mainfrom
OskarEichler:codex/preserve-quoted-values

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Preserve escaped backslashes and quotes, and serialize empty strings as quoted values. Previously values could be corrupted or serialized into text the parser rejected.

Reproduction and verification

p = WebSocket::Extensions::Parser
value = 'a' + 92.chr + 'b'
header = p.serialize_params('ext', {'v' => value})
p p.parse_header(header).by_name('ext').first['v'] == value # true

Eleven focused cases and 2,000 generated quoted-value round trips pass. Existing broadly accepted quoted-string values remain supported; this does not claim every such value satisfies a particular WebSocket extension specification.

  • Ruby 4.0.6 through rbenv; existing current-upstream suite: 64 examples, zero failures on this isolated change.
  • The cumulative release-based candidate passes 283 focused checks (272 baseline failures → zero), 2,784 model checks, the current upstream's 64-example suite, and gem build/extraction.
  • The historical 0.1.5 suite has three Ruby keyword-versus-options-hash mock failures on both baseline and candidate. Current upstream already corrected those expectations; they were run against the candidate through an external preload without changing repository tests.
  • No new or modified tests/specs, following the consumer repository's explicit policy. Reproductions/models were run from external scratch scripts.

Breaking changes and limitations

No intended breaking change. Backslashes/empty values round-trip correctly; numeric conversion behavior remains unchanged.

Only local Ruby 4.0.6/macOS execution is claimed; the repository's older Ruby/JRuby matrix needs upstream CI. No production access or unrelated release upgrades.

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.

1 participant