1
0
Fork 0

http protocol should not use TLS

I need this in order to run kubectl proxy and then
make traefik use http://localhost to get to my cluster
when developing
This commit is contained in:
Jonas Falck 2016-05-19 10:52:17 +02:00 committed by Vincent Demeester
parent fa25c8ef22
commit aeb9cc1732
2 changed files with 11 additions and 4 deletions

View file

@ -5,11 +5,12 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"github.com/containous/traefik/safe"
"github.com/parnurzeal/gorequest"
"net/http"
"net/url"
"strings"
"github.com/containous/traefik/safe"
"github.com/parnurzeal/gorequest"
)
const (
@ -201,6 +202,11 @@ func (c *clientImpl) do(request *gorequest.SuperAgent) ([]byte, error) {
func (c *clientImpl) request(url string) *gorequest.SuperAgent {
// Make request to Kubernetes API
request := gorequest.New().Get(url)
if strings.HasPrefix(url, "http://") {
return request
}
if len(c.token) > 0 {
request.Header["Authorization"] = "Bearer " + c.token
pool := x509.NewCertPool()