Summary
Response::location() currently returns the first raw header value. Add a bounded, typed Location response-metadata helper so callers can safely inspect redirect targets while retaining the existing raw-header API.
Acceptance criteria
- Add a public
rttp_protocol::location module with a Location value type and parse error type for one Location field value.
- Accept a non-empty absolute URI or relative URI reference after trimming HTTP optional whitespace; reject control bytes, unsafe field-value characters, malformed percent escapes, and values over 64 KiB.
- Add
Response::location() -> error::Result<Option<Location>>, returning Ok(None) when absent and an error for duplicate Location fields or malformed values. Preserve raw header access through the ordinary response accessors.
- Re-export the new types through
rttp_client::response and the public rttp client facade as appropriate.
- Add focused protocol and client tests for absolute and relative targets, absent values, duplicate fields, malformed input, and raw-header preservation.
- Keep the feature metadata-only: do not automatically follow redirects, resolve targets, retry/replay requests, or apply redirect policy.
Summary
Response::location()currently returns the first raw header value. Add a bounded, typedLocationresponse-metadata helper so callers can safely inspect redirect targets while retaining the existing raw-header API.Acceptance criteria
rttp_protocol::locationmodule with aLocationvalue type and parse error type for oneLocationfield value.Response::location() -> error::Result<Option<Location>>, returningOk(None)when absent and an error for duplicateLocationfields or malformed values. Preserve raw header access through the ordinary response accessors.rttp_client::responseand the publicrttpclient facade as appropriate.