]> Cypherpunks repositories - gostls13.git/commitdiff
http request URI should never be empty
authorMichael Hoisie <hoisie@gmail.com>
Mon, 22 Feb 2010 03:49:43 +0000 (19:49 -0800)
committerAndrew Gerrand <adg@golang.org>
Mon, 22 Feb 2010 03:49:43 +0000 (19:49 -0800)
R=rsc, adg
CC=golang-dev
https://golang.org/cl/217071

src/pkg/http/request.go

index d077224026d73a4e54be8fa995e248b83bce5974..89a5d837cdfbb75db9ac9b823cf1bc1ac46325c1 100644 (file)
@@ -167,7 +167,7 @@ func (req *Request) Write(w io.Writer) os.Error {
                host = req.URL.Host
        }
 
-       uri := urlEscape(req.URL.Path, false)
+       uri := valueOrDefault(urlEscape(req.URL.Path, false), "/")
        if req.URL.RawQuery != "" {
                uri += "?" + req.URL.RawQuery
        }