Add HTTP protocol version to response extra field#2466
Conversation
Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
|
@copilot Explore the ability to obtain the HTTP version from |
Findings from exploration:
So: reliable generic support is not available for native/web today; only Cronet has an adapter-specific path ( |
|
@copilot Move |
Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Implemented in 6d1a1e9. |
|
@copilot rename httpVersionKey to extraKeyHttpVersion |
Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Expose the negotiated HTTP protocol version in
Response.extraso it can be used for telemetry and observability.Changes Made
IOHttpClientAdapterpopulates the value fromdart:ioresponse headers (best-effort).Http2Adaptersets the value to2.0and preserves any pre-existing value (??=).HttpClientAdapter, and renamed it to:HttpClientAdapter.extraKeyHttpVersionweb_adapterandnative_dio_adapter) depending on transport metadata support.HttpClientAdapter.extraKeyHttpVersionand verify behavior indioandhttp2_adapter.Notes
web_adapterusesXMLHttpRequest, which does not reliably expose negotiated HTTP protocol version.native_dio_adapterusespackage:httpresponse abstractions in its shared conversion layer, which do not provide a generic HTTP version field.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.