Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(616)

Issue 5010044: code review 5010044: http/cgi: clean up environment. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 6 months ago by mattn
Modified:
13 years, 6 months ago
Reviewers:
CC:
golang-dev_googlecode.com, bradfitz, bradfitzgoog, golang-dev
Visibility:
Public.

Description

http/cgi: clean up environment. clean up duplicate environment for CGI. overriding former by latter. On windows, When there are duplicated environments like following, SCRIPT_FILENAME=c:/progra~1/php/php-cgi.exe SCRIPT_FILENAME=/foo.php CreateProcess use first entry. If make cgi.Handle like following, cgih = cgi.Handler{ Path: "c:/strawberry/perl/bin/perl.exe", Dir: "c:/path/to/webroot", Root: "c:/path/to/webroot", Args: []string{"foo.php"}, Env: []string{"SCRIPT_FILENAME=foo.php"}, } http/cgi should behave "SCRIPT_FILENAME is foo.php". But currently, http/cgi is set duplicate environment entries. So, browser show binary dump of "php-cgi.exe" that is specified indented SCRIPT_FILENAME in first entry. This change clean up duplicates, and use latters.

Patch Set 1 #

Patch Set 2 : diff -r 805742b53bf3 http://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 805742b53bf3 http://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 4 : diff -r 805742b53bf3 http://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 805742b53bf3 http://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 805742b53bf3 http://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -0 lines) Patch
M src/pkg/http/cgi/host.go View 1 2 3 2 chunks +27 lines, -0 lines 0 comments Download
M src/pkg/http/cgi/host_test.go View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 6
mattn
Hello golang-dev@googlecode.com, bradfitz@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to http://go.googlecode.com/hg/
13 years, 6 months ago (2011-09-15 09:20:45 UTC) #1
bradfitz
Add a little test too? http://codereview.appspot.com/5010044/diff/4001/src/pkg/http/cgi/host.go File src/pkg/http/cgi/host.go (right): http://codereview.appspot.com/5010044/diff/4001/src/pkg/http/cgi/host.go#newcode71 src/pkg/http/cgi/host.go:71: func cleanEnv(env []string) (ret ...
13 years, 6 months ago (2011-09-15 17:53:14 UTC) #2
mattn
Hello golang-dev@googlecode.com, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 6 months ago (2011-09-16 02:10:03 UTC) #3
mattn
http://codereview.appspot.com/5010044/diff/4001/src/pkg/http/cgi/host.go File src/pkg/http/cgi/host.go (right): http://codereview.appspot.com/5010044/diff/4001/src/pkg/http/cgi/host.go#newcode71 src/pkg/http/cgi/host.go:71: func cleanEnv(env []string) (ret []string) { On 2011/09/15 17:53:14, ...
13 years, 6 months ago (2011-09-16 02:12:16 UTC) #4
bradfitzgoog
LGTM
13 years, 6 months ago (2011-09-16 17:36:48 UTC) #5
bradfitz
13 years, 6 months ago (2011-09-16 17:36:58 UTC) #6
*** Submitted as http://code.google.com/p/go/source/detail?r=68ba2ebd1645 ***

http/cgi: clean up environment.
clean up duplicate environment for CGI.
overriding former by latter.
On windows, When there are duplicated environments like following,

SCRIPT_FILENAME=c:/progra~1/php/php-cgi.exe
SCRIPT_FILENAME=/foo.php

CreateProcess use first entry.

If make cgi.Handle like following,

        cgih = cgi.Handler{
                Path: "c:/strawberry/perl/bin/perl.exe",
                Dir:  "c:/path/to/webroot",
                Root: "c:/path/to/webroot",
                Args: []string{"foo.php"},
                Env:  []string{"SCRIPT_FILENAME=foo.php"},
        }

http/cgi should behave "SCRIPT_FILENAME is foo.php".
But currently, http/cgi is set duplicate environment entries.
So, browser show binary dump of "php-cgi.exe" that is specified indented
SCRIPT_FILENAME in first entry.
This change clean up duplicates, and use latters.

R=golang-dev, bradfitz, bradfitz
CC=golang-dev
http://codereview.appspot.com/5010044

Committer: Brad Fitzpatrick <bradfitz@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b