Skip to content

Add typed User-Agent server request accessors - #923

Merged
fewensa merged 1 commit into
mainfrom
codeon/fewensa/FWN-326/a1
Sep 5, 2026
Merged

Add typed User-Agent server request accessors#923
fewensa merged 1 commit into
mainfrom
codeon/fewensa/FWN-326/a1

Conversation

@fewensa

@fewensa fewensa commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Expose typed User-Agent accessors on Request and HttpRequest by consuming rttp-protocol::user_agent.

Request::user_agent() and HttpRequest::user_agent() return Ok(None) when the field is absent, parse a singleton field through parse_values, and reject duplicate field lines, malformed products or comments, forbidden controls, and bound violations without flattening. Raw header() access is unchanged after typed parse errors. HttpUserAgent, HttpUserAgentMember, and HttpUserAgentParseError are re-exported beside neighboring request metadata aliases. The server README documents this as syntax-only metadata and does not use User-Agent for routing, authentication, logging, fingerprinting, or request acceptance.

Focused HTTP/1.1 and HTTP/2 tests cover valid, absent, duplicate, malformed, bound, and raw-header preservation cases. cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo test --all-features passed.

codeon:
  version: 1
  authority: FWN-326
  description: |-
    Expose Request::user_agent and HttpRequest::user_agent through the shared rttp-protocol User-Agent primitive. Absent fields return Ok(None); duplicate field lines, malformed products or comments, forbidden controls, and bound violations return the typed parse error without flattening. Re-export HttpUserAgent aliases, document syntax-only metadata in the server README, and add HTTP/1.1 plus HTTP/2 tests that preserve raw headers after typed parse failures.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@fewensa
fewensa merged commit d30a69f into main Sep 5, 2026
1 check passed
@fewensa
fewensa deleted the codeon/fewensa/FWN-326/a1 branch September 5, 2026 02:45
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