api: check before using pre-resolved address #7529

Merged
merged 1 commit into from Jun 21, 2017

Conversation

Projects
None yet
3 participants
Member

axw commented Jun 21, 2017

Description of change

When dialing a websocket, check that the address
we're asked to dial is the same as the one that
we pre-resolved. It will not match when we're
using a proxy.

This is a short-term fix. If we should be doing
any client-side resolution at all, it should be
disabled when a proxy is to be used.

QA steps

  1. juju bootstrap localhost
  2. go get github.com/elazarl/goproxy, then go run the following program:
package main

import (
    "github.com/elazarl/goproxy"
    "log"
    "net/http"
)

func main() {
    proxy := goproxy.NewProxyHttpServer()
    proxy.Verbose = true
    log.Fatal(http.ListenAndServe(":8080", proxy))
}
  1. export https_proxy=localhost:8080
  2. juju status

Documentation changes

None.

Bug reference

Fixes https://bugs.launchpad.net/juju/+bug/1698989

api: check before using pre-resolved address
When dialing a websocket, check that the address
we're asked to dial is the same as the one that
we pre-resolved. It will not match when we're
using a proxy.

This is a short-term fix. If we should be doing
any client-side resolution at all, it should be
disabled when a proxy is to be used.

Fixes https://bugs.launchpad.net/juju/+bug/1698989
Member

axw commented Jun 21, 2017

$$merge$$

Contributor

jujubot commented Jun 21, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit b8cedcc into juju:2.2 Jun 21, 2017

1 check passed

github-check-merge-juju Ran tests against PR. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment