in reply to CORS header in XMLRPC::Transport::HTTP::Daemon
SOAP::Lite implements the server part through https://metacpan.org/pod/distribution/SOAP-Lite/lib/SOAP/Transport.pod#SOAP::Transport::HTTP and https://metacpan.org/pod/distribution/SOAP-Lite/lib/SOAP/Transport.pod#SOAP::Transport::HTTP::Server.
From reading the documentation, you can either replace the server class by your own server or monkeypatch the ->response method to modify the response when it gets stored.
use SOAP::Transport::HTTP my $old_response = \&SOAP::Transport::HTTP::Server::response; *SOAP::Transport::HTTP::Server::response = sub { my $resp = $old_response->( @_ ); $resp->headers->header('Access-Control-Allow-Origin' => '*'); # is + this wise?! return $resp; };
|
|---|