Add a model and parser for the RFC 9209 Proxy-Status response field - #689
Add a model and parser for the RFC 9209 Proxy-Status response field#689arturobernalg wants to merge 1 commit into
Conversation
Proxy-Status is a Structured Fields (RFC 8941) List whose members carry an intermediary identity and a set of parameters. ProxyStatus is an immutable holder for a single member, ProxyStatusError enumerates the standardized error tokens, and ProxyStatusSupport parses the field value. Parameter values keep their structured-field types, the standardized and error-specific parameter types are validated, received-status is checked as an HTTP status code, and byte-sequence values are defensively copied. The code only decodes the field; it neither interprets nor acts on the reported values.
| */ | ||
| public static List<ProxyStatus> parse(final CharSequence value) throws ParseException { | ||
| Args.notNull(value, "Proxy-Status value"); | ||
| final ParserCursor cursor = new ParserCursor(0, value.length()); |
There was a problem hiding this comment.
@arturobernalg Keep it flexible and pass ParserCursor as a parameter. That would enable the parse message to take its input from directly FormattedHeader without having to make an intermediate String out of it.
See MessageSupport#parserHeaderValue
|
@arturobernalg Overall, what is your plan for this code? Is this something that you need at work or for a private project? I do not see this code applicable anywhere in neither core or client at the moment. What is the plan? |
It is not for a specific work or private project. My intention was to add RFC 9209 support incrementally. I started with Core because the field syntax and model are generic HTTP semantics rather than client policy. |
@arturobernalg Your plan is to provide it out of client? If so, this code should go to client. It can be moved to core once considered stable and there is an actual need for it. |
@ok2c . That makes sense — I’ll move the implementation to Client first and keep it there until there is a demonstrated need to expose it from Core. |
Proxy-Status is a Structured Fields (RFC 8941) List whose members carry an intermediary identity and a set of parameters. ProxyStatus is an immutable holder for a single member, ProxyStatusError enumerates the standardized error tokens, and ProxyStatusSupport parses the field value. Parameter values keep their structured-field types, the standardized and error-specific parameter types are validated, received-status is checked as an HTTP status code, and byte-sequence values are defensively copied. The code only decodes the field; it neither interprets nor acts on the reported values.