/[jscoverage]/trunk/tests/server.pl
ViewVC logotype

Diff of /trunk/tests/server.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 126 by siliconforks, Mon Jun 2 17:53:43 2008 UTC revision 224 by siliconforks, Fri Oct 3 02:28:21 2008 UTC
# Line 26  Line 26 
26        binmode FILE;        binmode FILE;
27        my $content = <FILE>;        my $content = <FILE>;
28        close FILE;        close FILE;
29        my $content_type;        my @headers = ('Connection' => 'close');
30        if ($file =~ /\.js$/) {        if ($file =~ /\.js$/) {
31          $content_type = 'text/javascript';          push @headers, 'Content-Type' => 'text/javascript';
32          }
33          elsif ($file =~ /\.[^\/]+$/) {
34            push @headers, 'Content-Type' => 'application/octet-stream';
35        }        }
36        else {        else {
37          $content_type = 'application/octet-stream';          # do nothing - no Content-Type
38        }        }
39        my $response = HTTP::Response->new(200, 'OK', ['Connection' => 'close', 'Content-Type' => $content_type], $content);        my $response = HTTP::Response->new(200, 'OK', \@headers, $content);
40        $c->send_response($response);        $c->send_response($response);
41      }      }
42      else {      else {

Legend:
Removed from v.126  
changed lines
  Added in v.224

  ViewVC Help
Powered by ViewVC 1.1.24