Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: transport.go: proxy errors ignored #8755

Closed
gopherbot opened this issue Sep 16, 2014 · 5 comments
Closed

net/http: transport.go: proxy errors ignored #8755

gopherbot opened this issue Sep 16, 2014 · 5 comments

Comments

@gopherbot
Copy link

by jtuley@pivotal.io:

In Go 1.3 (specifically revision 22fe13ae3884ef4349cfb78ad5804ebc0c8759d0 on
2014-01-30), the connectMethodForRequest function lost its return when t.Proxy returns
an error.

Before (a177faebc7fc36ee005361a6b27932a774bf70a5):

func (t *Transport) connectMethodForRequest(treq *transportRequest) (*connectMethod,
error) {
    cm := &connectMethod{
        targetScheme: treq.URL.Scheme,
        targetAddr:   canonicalAddr(treq.URL),
    }
    if t.Proxy != nil {
        var err error
        cm.proxyURL, err = t.Proxy(treq.Request)
        if err != nil {
            return nil, err
        }
    }
    return cm, nil
}


After (22fe13ae3884ef4349cfb78ad5804ebc0c8759d0):

func (t *Transport) connectMethodForRequest(treq *transportRequest) (cm connectMethod,
err error) {
    cm.targetScheme = treq.URL.Scheme
    cm.targetAddr = canonicalAddr(treq.URL)
    if t.Proxy != nil {
        cm.proxyURL, err = t.Proxy(treq.Request)
    }
    return cm, nil
}
@ianlancetaylor
Copy link
Contributor

Comment 1:

I think the intent was for the last line to be "return cm, err".
Brad?

Labels changed: added repo-main, release-none.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 2 by jtuley@pivotal.io:

That's what I expect as well. I'm working on a test and fix, and going through the
Contribution Guidelines to figure out how to get the change in.

@gopherbot
Copy link
Author

Comment 3 by jtuley@pivotal.io:

I submitted a fix: https://golang.org/cl/136710044. (I'm not sure why it wasn't
linked to the issue; I must have misunderstood the correct notation in the description.)

@gopherbot
Copy link
Author

Comment 4:

CL https://golang.org/cl/136710044 mentions this issue.

@bradfitz
Copy link
Contributor

Comment 5:

This issue was closed by revision 0c47bd1.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants