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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user