Repository navigation
Conversation
Choose the initial format from both ID and length, validate before mutation, and honor an explicitly requested profile on the first call. Reject empty one-byte payloads and invalid profile conversions. Add wire round-trip and unchanged-on-error regression tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first Header.SetExtension call can select the one-byte format for IDs
above 14, accept invalid IDs or lengths, and serialize a different extension
than the caller requested. SetExtensionWithProfile also ignores the requested
profile when the header has no extensions.
Select the automatic profile from both the ID and payload length, and
validate before mutating the header. Honor an explicit first profile and
validate existing extensions before converting formats. Reject empty
one-byte payloads through the shared validator used by Header and
OneByteHeaderExtension.
The first-extension validation overlaps with the earlier, closed #374 by
@RaphaelFakhri and the behavior discussed in #255. This patch also covers the
explicit-profile first call and invalid format conversions. No dependency
or exported API changes are included.
Validation on Go 1.26.5 / darwin-arm64:
9a8f935, 14 of 20 table cases fail, as does the empty one-byte payload test.
The shared validator has a targeted cyclop suppression because enforcing
the missing minimum length brings its complexity from 10 to 11.