• Yasuhiro Matsumoto's avatar
    http/cgi: clean up environment. · 048ec758
    Yasuhiro Matsumoto authored
    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
    https://golang.org/cl/5010044
    048ec758
host_test.go 11.3 KB