| 1 | package Claude::Agent::MCP::HTTPServer; | ||||||||||
| 2 | |||||||||||
| 3 | 8 | ▶ | use 5.020; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 8 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 8 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 8 | ▶ | use Object::Proto (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 8 | ▶ | use Claude::Agent::MCP::HeaderUtils (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 8 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 8 | Object::Proto::define('Claude::Agent::MCP::HTTPServer', | |||||||||
| 12 | 'url:Str:required', | ||||||||||
| 13 | 'headers:HashRef:default({})', | ||||||||||
| 14 | 'sensitive_headers:ArrayRef:default([])', | ||||||||||
| 15 | 'type:Str:readonly:default(http)', | ||||||||||
| 16 | ); | ||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 3 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 20 | 3 | my ($self) = @_; | |||||||||
| 21 | 3 | ▶ | die "URL must use http or https scheme" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | unless $self->url =~ m{^https?://}i; | ||||||||||
| 23 | 3 | return; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 3 | ▶ | sub is_sensitive_header { | ||||||||
|
Subroutine
is_sensitive_header: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 27 | 3 | my ($self, $header_name) = @_; | |||||||||
| 28 | 3 | return Claude::Agent::MCP::HeaderUtils::is_sensitive_header( | |||||||||
| 29 | $header_name, $self->sensitive_headers | ||||||||||
| 30 | ); | ||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 1 | ▶ | sub redacted_headers { | ||||||||
|
Subroutine
redacted_headers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 34 | 1 | my ($self) = @_; | |||||||||
| 35 | 1 | return Claude::Agent::MCP::HeaderUtils::redacted_headers( | |||||||||
| 36 | $self->headers, $self->sensitive_headers | ||||||||||
| 37 | ); | ||||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 2 | ▶ | sub to_hash { | ||||||||
|
Subroutine
to_hash: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 41 | 2 | my ($self) = @_; | |||||||||
| 42 | return { | ||||||||||
| 43 | 2 | type => 'http', | |||||||||
| 44 | url => $self->url, | ||||||||||
| 45 | headers => $self->headers, | ||||||||||
| 46 | }; | ||||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 8 | 1; | |||||||||
| 50 | |||||||||||
| 51 | __END__ | ||||||||||