-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[H/3] Clean up and fix Alt-Svc handling #114528
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpRequestHeadersTest.cs:277
- After re-adding the 'Alt-Svc' header with the value 'clear', consider adding an assertion to verify that the header was processed as expected, ensuring the roundtrip behavior is fully validated.
headers.Add("Alt-Svc", value);
ExpireAltSvcAuthority(); | ||
Debug.Assert(_authorityExpireTimer != null || _disposed); | ||
_authorityExpireTimer?.Change(Timeout.Infinite, Timeout.Infinite); | ||
break; | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a clarifying comment above the 'return' statement to document that returning immediately upon handling a 'clear' Alt-Svc header is an intentional control flow decision to prevent further header processing.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -13,7 +13,9 @@ namespace System.Net.Http.Headers | |||
/// </remarks> | |||
internal sealed class AltSvcHeaderValue | |||
{ | |||
public static AltSvcHeaderValue Clear { get; } = new AltSvcHeaderValue("clear", host: null, port: 0, maxAge: TimeSpan.Zero, persist: false); | |||
public static string ClearString { get; } = "clear"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
public static string ClearString { get; } = "clear"; | |
public const string ClearString = "clear"; |
No need respin CI just for this though.
Fixes #83775
Fixes #83874
ToString
for "Alt-Svc: clear".HttpAuthority
comparison by overloading==
operator (class is internal, not public).