Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from hpcloud/refactor-proxying-to-support-any-cnsi
Browse files Browse the repository at this point in the history
This LGTM
  • Loading branch information
wchrisjohnson committed Apr 29, 2016
2 parents 8160aef + b249024 commit 7c38b29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ func start(p *portalProxy) {
e.Run(engine)
}

// sync.RWMutex

func (p *portalProxy) initCookieStore() {
p.CookieStore = sessions.NewCookieStore([]byte(p.Config.CookieStoreSecret))
}
Expand All @@ -92,6 +90,5 @@ func (p *portalProxy) registerRoutes(e *echo.Echo) {
sessionGroup.Post("/register/hcf", p.registerHCFCluster)
sessionGroup.Get("/cnsis", p.listRegisteredCNSIs)
group := sessionGroup.Group("/proxy")
group.Get("/hcf/*", p.hcf)
group.Get("/hce/*", p.hce)
group.Get("/*", p.proxy)
}
6 changes: 1 addition & 5 deletions passthrough.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (p *portalProxy) validateCNSIList(cnsiList []string) error {
return nil
}

func (p *portalProxy) hcf(c echo.Context) error {
func (p *portalProxy) proxy(c echo.Context) error {
cnsiList := strings.Split(c.Request().Header().Get("x-cnap-cnsi-list"), ",")
if err := p.validateCNSIList(cnsiList); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
Expand Down Expand Up @@ -183,10 +183,6 @@ func (p *portalProxy) hcf(c echo.Context) error {
return err
}

func (p *portalProxy) hce(c echo.Context) error {
return nil
}

func (p *portalProxy) doRequest(cnsiRequest CNSIRequest, done chan<- CNSIRequest, kill <-chan struct{}) {
var body io.Reader
var res *http.Response
Expand Down

0 comments on commit 7c38b29

Please sign in to comment.