Skip to content

Commit

Permalink
Merge pull request #541 from rgooch/master
Browse files Browse the repository at this point in the history
Fix metadata server to only serve hypervisor VMs for all requests.
  • Loading branch information
rgooch committed Dec 10, 2018
2 parents 28a992b + 0e95717 commit fec1543
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hypervisor/metadatad/httpHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ func (s *server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
ipAddr := net.ParseIP(hostname)
s.manager.NotifyVmMetadataRequest(ipAddr, req.URL.Path)
if rawHandler, ok := s.rawHandlers[req.URL.Path]; ok {
rawHandler(w, ipAddr)
return
}
vmInfo, err := s.manager.GetVmInfo(ipAddr)
if err != nil {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusNotFound)
return
}
if rawHandler, ok := s.rawHandlers[req.URL.Path]; ok {
rawHandler(w, ipAddr)
return
}
writer := bufio.NewWriter(w)
defer writer.Flush()
if infoHandler, ok := s.infoHandlers[req.URL.Path]; ok {
Expand Down

0 comments on commit fec1543

Please sign in to comment.