-
Notifications
You must be signed in to change notification settings - Fork 103
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
fix AspNet productInfo #2168
base: dev
Are you sure you want to change the base?
fix AspNet productInfo #2168
Conversation
827676f
to
515bb98
Compare
protected abstract void SetCustomHeaders(IDictionary<string, string> headers); | ||
|
||
private static void CheckHeaders(IDictionary<string, string> headers, string forbidPrefix) | ||
private static void CheckHeadersPrefix(IDictionary<string, string> headers, string forbidPrefix) |
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.
use params string[]
?
{ | ||
var key = item.First().Key; | ||
var key = item[0].Key; |
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.
why only reporting first key
return headers; | ||
} | ||
|
||
internal virtual void SetInternalHeaders(IDictionary<string, string> headers) | ||
internal virtual void SetServerId(IDictionary<string, string> headers) |
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.
private is enough? We already have customServerIdProvider to hook in server id
This pull request focuses on improving the handling of headers in the
ConnectionFactory
classes and updating relevant tests to ensure proper functionality. The key changes include refactoring methods for setting headers, adding a new method for setting the internal user agent, and updating test cases accordingly.Improvements to header handling:
src/Microsoft.Azure.SignalR.AspNet/ServerConnections/ConnectionFactory.cs
: Added a new methodSetInternalUserAgent
to handle setting the user agent header, addressing an issue with .NET Framework restrictions on reserved strings as header names.src/Microsoft.Azure.SignalR.Common/ServiceConnections/ConnectionFactoryBase.cs
: Refactored methods to separate the setting of internal headers and user agent, and renamed methods for clarity. [1] [2] [3]src/Microsoft.Azure.SignalR.Management/ManagementConnectionFactory.cs
: Updated method overrides to use the newSetInternalUserAgent
method for setting the user agent header.Updates to test cases:
test/Microsoft.Azure.SignalR.AspNet.Tests/ConnectionFactoryTests.cs
: Added new test cases to validate the correct setting of request headers, including the user agent and server ID.test/Microsoft.Azure.SignalR.Management.Tests/ManagementConnectionFactoryTests.cs
: Updated existing test cases to reflect changes in user agent header values. [1] [2]test/Microsoft.Azure.SignalR.Tests/ConnectionFactoryTests.cs
: Modified test cases to ensure proper handling of custom headers and validation of user agent header format. [1] [2]