Align x-mcp-header implementation with SEP-2243 spec clarifications (#1619)
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
719eade5e0
commit
ed19286a08
1 changed files with 1035 additions and 116 deletions
|
|
@ -9,6 +9,9 @@ public class McpHeaderAttributeTests
|
|||
[InlineData("TenantId")]
|
||||
[InlineData("Priority")]
|
||||
[InlineData("X-Custom")]
|
||||
[InlineData("x!header")]
|
||||
[InlineData("x#header")]
|
||||
[InlineData("x~header")]
|
||||
public void Constructor_ValidHeaderName_Succeeds(string name)
|
||||
{
|
||||
var attr = new McpHeaderAttribute(name);
|
||||
|
|
@ -27,6 +30,23 @@ public class McpHeaderAttributeTests
|
|||
Assert.Throws<ArgumentException>(() => new McpHeaderAttribute("Region:Primary"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Region(1)")]
|
||||
[InlineData("path/to")]
|
||||
[InlineData("key=value")]
|
||||
[InlineData("name@host")]
|
||||
[InlineData("with,comma")]
|
||||
[InlineData("with;semi")]
|
||||
[InlineData("with[bracket")]
|
||||
[InlineData("with{brace")]
|
||||
[InlineData("with\"quote")]
|
||||
[InlineData("with\\backslash")]
|
||||
[InlineData("with?question")]
|
||||
public void Constructor_NonTcharCharacter_Throws(string name)
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => new McpHeaderAttribute(name));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_NullName_Throws()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue