@@ -55,6 +55,7 @@ func TestServe(t *testing.T) {
5555 except /servertime/1934
5656 exec {.}/test/example --example
5757 env CGI_GLOBAL=12
58+ empty_env CGI_LOCAL
5859}` ,
5960 }
6061
@@ -69,31 +70,56 @@ func TestServe(t *testing.T) {
6970cgi /servertime {.}/test/example
7071--- Request /servertime ---
7172code [0], error [example error message]
72- [---] [---] [---] [quixote] [] []
73+ PATH_INFO []
74+ CGI_GLOBAL []
75+ Arg 1 []
76+ QUERY_STRING []
77+ HTTP_TOKEN_CLAIM_USER [quixote]
78+ CGI_LOCAL is unset
7379--- Request /servertime/1930/05/11?name=Edsger%20W.%20Dijkstra ---
7480code [0], error [example error message]
75- [/1930/05/11] [---] [---] [---] [name=Edsger%20W.%20Dijkstra] [quixote]
81+ PATH_INFO [/1930/05/11]
82+ CGI_GLOBAL []
83+ Arg 1 []
84+ QUERY_STRING [name=Edsger%20W.%20Dijkstra]
85+ HTTP_TOKEN_CLAIM_USER [quixote]
86+ CGI_LOCAL is unset
7687--- Request /servertime/1934/02/15?name=Niklaus%20Wirth ---
7788code [0], error [example error message]
78- [/1934/02/15] [---] [---] [---] [name=Niklaus%20Wirth] [quixote]
89+ PATH_INFO [/1934/02/15]
90+ CGI_GLOBAL []
91+ Arg 1 []
92+ QUERY_STRING [name=Niklaus%20Wirth]
93+ HTTP_TOKEN_CLAIM_USER [quixote]
94+ CGI_LOCAL is unset
7995--- Request /example.txt ---
8096=== Directive 1 ===
8197cgi {
8298 match /servertime
8399 except /servertime/1934
84100 exec {.}/test/example --example
85101 env CGI_GLOBAL=12
102+ empty_env CGI_LOCAL
86103}
87104--- Request /servertime ---
88105code [0], error [example error message]
89- [---] [12] [--example] [quixote] [] []
106+ PATH_INFO []
107+ CGI_GLOBAL [12]
108+ Arg 1 [--example]
109+ QUERY_STRING []
110+ HTTP_TOKEN_CLAIM_USER [quixote]
111+ CGI_LOCAL is set to []
90112--- Request /servertime/1930/05/11?name=Edsger%20W.%20Dijkstra ---
91113code [0], error [example error message]
92- [/1930/05/11] [---] [12] [--example] [name=Edsger%20W.%20Dijkstra] [quixote]
114+ PATH_INFO [/1930/05/11]
115+ CGI_GLOBAL [12]
116+ Arg 1 [--example]
117+ QUERY_STRING [name=Edsger%20W.%20Dijkstra]
118+ HTTP_TOKEN_CLAIM_USER [quixote]
119+ CGI_LOCAL is set to []
93120--- Request /servertime/1934/02/15?name=Niklaus%20Wirth ---
94121--- Request /example.txt ---
95122`
96-
97123 // Testing the ServeHTTP method requires OS-specific CGI scripts, because a
98124 // system call is made to respond to the request.
99125 if runtime .GOOS == "linux" || runtime .GOOS == "darwin" {
0 commit comments