From 50104cc32a498f7517a51c8dc93106c51c7a54b4 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Wed, 20 Apr 2011 15:44:41 +0200 Subject: Imported Upstream version 2011.03.07.1 --- src/pkg/http/cgi/testdata/test.cgi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 src/pkg/http/cgi/testdata/test.cgi (limited to 'src/pkg/http/cgi/testdata') diff --git a/src/pkg/http/cgi/testdata/test.cgi b/src/pkg/http/cgi/testdata/test.cgi new file mode 100755 index 000000000..b931b04c5 --- /dev/null +++ b/src/pkg/http/cgi/testdata/test.cgi @@ -0,0 +1,34 @@ +#!/usr/bin/perl +# Copyright 2011 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +# Test script run as a child process under cgi_test.go + +use strict; +use CGI; + +my $q = CGI->new; +my $params = $q->Vars; + +my $NL = "\r\n"; +$NL = "\n" if 1 || $params->{mode} eq "NL"; + +my $p = sub { + print "$_[0]$NL"; +}; + +# With carriage returns +$p->("Content-Type: text/html"); +$p->("X-Test-Header: X-Test-Value"); +$p->(""); + +print "test=Hello CGI\n"; + +foreach my $k (sort keys %$params) { + print "param-$k=$params->{$k}\n"; +} + +foreach my $k (sort keys %ENV) { + print "env-$k=$ENV{$k}\n"; +} -- cgit v1.2.3