IMHO there should be a switch for nph
I tried to modify SOAP/Transport/HTTP.pm. Since I hardly have any experience at patching others' code, I thought it would be a good idea to ask for advice here instead of submitting a possibly wrong bug report/fix. Well, this is the original code of S::T::H::CGI::handle:
And I applied these changes:
# imitate nph- cgi for IIS (pointed by Murray Nesbitt)
- my $status = defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTW
+ARE'}=~/IIS/
- ? $ENV{SERVER_PROTOCOL} || 'HTTP/1.0' : 'Status:';
+ my $status;
+ if ($self->{'nph'}) {
+ $status = $ENV{SERVER_PROTOCOL} || 'HTTP/1.0';
+ } else {
+ $status = defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWA
+RE'}=~/IIS/
+ ? $ENV{SERVER_PROTOCOL} || 'HTTP/1.0' : 'Status:';
+ }
my $code = $self->response->code;
Plus, I added a nph function:
sub nph {
my $self = shift;
$self->{'nph'} = 1;
return $self;
}
So now, I just add a call to nph and I get a proper HTTP response:
SOAP::Transport::HTTP::CGI
->dispatch_to ('/home/hue/lang/perl/modules', 'HelloWorld')
->nph
->handle;
Do you monks thing it's ok to submit this? Thank you for your valuable input.
|