fix: reset request context after the MCP request, resolve client name

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-25 21:43:07 +02:00
co-authored by Claude Opus 5.5
parent f63d35c2f8
commit 720d0891c4
3 changed files with 147 additions and 23 deletions
+7 -1
View File
@@ -5,7 +5,8 @@ declare(strict_types=1);
if (! class_exists('WP_REST_Request')) {
class WP_REST_Request
{
public function __construct(private string $route = '')
/** @param array<string, string> $headers Lower-case header name => value. */
public function __construct(private string $route = '', private array $headers = [])
{
}
@@ -13,5 +14,10 @@ if (! class_exists('WP_REST_Request')) {
{
return $this->route;
}
public function get_header(string $key): ?string
{
return $this->headers[strtolower($key)] ?? null;
}
}
}