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

Issue 4798046: code review 4798046: undo CL 4808044 / 1bd754e69ce7 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 8 months ago by rsc
Modified:
13 years, 8 months ago
Reviewers:
CC:
bradfitz, golang-dev
Visibility:
Public.

Description

undo CL 4808044 / 1bd754e69ce7 ServeMux depends on having a URL in order to mux. It might be that the right fix is to have CONNECT handlers just not look at URL. ««« original CL description http: do not parse req.URL for CONNECT CONNECT's argument is not a URL. R=golang-dev, bradfitz, rsc CC=golang-dev http://codereview.appspot.com/4808044 Committer: Russ Cox <rsc@golang.org> »»»

Patch Set 1 #

Patch Set 2 : diff -r 1bd754e69ce7 https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -30 lines) Patch
M src/pkg/http/readrequest_test.go View 1 1 chunk +0 lines, -22 lines 0 comments Download
M src/pkg/http/request.go View 1 2 chunks +3 lines, -8 lines 0 comments Download

Messages

Total messages: 3
rsc
Hello bradfitz (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
13 years, 8 months ago (2011-07-21 17:25:53 UTC) #1
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=52d566387339 *** undo CL 4808044 / 1bd754e69ce7 ServeMux depends on having a ...
13 years, 8 months ago (2011-07-21 17:25:59 UTC) #2
bradfitz
13 years, 8 months ago (2011-07-21 17:28:37 UTC) #3
LGTM

On Thu, Jul 21, 2011 at 10:25 AM, <rsc@golang.org> wrote:

> Reviewers: bradfitz,
>
> Message:
> Hello bradfitz (cc: golang-dev@googlegroups.com),
>
> I'd like you to review this change to
> https://go.googlecode.com/hg
>
>
> Description:
> undo CL 4808044 / 1bd754e69ce7
>
> ServeMux depends on having a URL
> in order to mux.  It might be that the right
> fix is to have CONNECT handlers just not
> look at URL.
>
> ««« original CL description
> http: do not parse req.URL for CONNECT
>
> CONNECT's argument is not a URL.
>
> R=golang-dev, bradfitz, rsc
> CC=golang-dev
> http://codereview.appspot.com/**4808044<http://codereview.appspot.com/4808044>
>
> Committer: Russ Cox <rsc@golang.org>
> »»»
>
> Please review this at
http://codereview.appspot.com/**4798046/<http://codereview.appspot.com/4798046/>
>
> Affected files:
>  M src/pkg/http/readrequest_test.**go
>  M src/pkg/http/request.go
>
>
> Index: src/pkg/http/readrequest_test.**go
> ==============================**==============================**=======
> --- a/src/pkg/http/readrequest_**test.go
> +++ b/src/pkg/http/readrequest_**test.go
> @@ -152,28 +152,6 @@
>                noBody,
>                "parse : empty url",
>        },
> -
> -       // CONNECT method.
> -       {
> -               "CONNECT proxy.example.com:443 HTTP/1.0\r\n" +
> -                       "Host: proxy.example.com\r\n\r\n",
> -
> -               &Request{
> -                       Method:        "CONNECT",
> -                       RawURL:        "proxy.example.com:443",
> -                       URL:           nil,
> -                       Proto:         "HTTP/1.0",
> -                       ProtoMajor:    1,
> -                       ProtoMinor:    0,
> -                       Close:         false,
> -                       ContentLength: 0,
> -                       Host:          "proxy.example.com",
> -                       Form:          Values{},
> -               },
> -
> -               noBody,
> -               noError,
> -       },
>  }
>
>  func TestReadRequest(t *testing.T) {
> Index: src/pkg/http/request.go
> ==============================**==============================**=======
> --- a/src/pkg/http/request.go
> +++ b/src/pkg/http/request.go
> @@ -548,11 +548,8 @@
>                return nil, &badStringError{"malformed HTTP version",
> req.Proto}
>        }
>
> -       isConnect := strings.ToUpper(req.Method) == "CONNECT"
> -       if !isConnect {
> -               if req.URL, err = ParseRequestURL(req.RawURL); err != nil {
> -                       return nil, err
> -               }
> +       if req.URL, err = ParseRequestURL(req.RawURL); err != nil {
> +               return nil, err
>        }
>
>        // Subsequent lines: Key: value.
> @@ -569,9 +566,7 @@
>        //      GET
http://www.google.com/index.**html<http://www.google.com/index.html>HTTP/1.1
>        //      Host: doesntmatter
>        // the same.  In the second case, any Host line is ignored.
> -       if !isConnect {
> -               req.Host = req.URL.Host
> -       }
> +       req.Host = req.URL.Host
>        if req.Host == "" {
>                req.Host = req.Header.Get("Host")
>        }
>
>
>
Sign in to reply to this message.

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