From b2ed4102763421924b29ab4bb6be1a1e5b4b9647 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 22 Mar 2025 05:22:04 -0500 Subject: work on setting the hostname in the patchset --- http.go | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'http.go') diff --git a/http.go b/http.go index dbc0cb0..6c7b116 100644 --- a/http.go +++ b/http.go @@ -11,36 +11,6 @@ import ( "go.wit.com/log" ) -/* -func (f *Forge) HttpPostMachine(url string) ([]byte, error) { - if f.Machine == nil { - // run f.InitMachine() here? - log.Info("you must run f.InitMachine()") - return nil, fmt.Errorf("you must run f.InitMachine()") - } - if f.Machine.Hostname == "" { - log.Info("WTF. hostname is blank") - } else { - log.Info("GOOD. hostname is set to", f.Machine.Hostname) - } - log.Info("GOOD2. hostname is set to", f.Machine.Hostname) - msg, err := f.Machine.Marshal() - if err != nil { - log.Info("proto.Marshal() failed:", err) - return nil, err - } - log.Info("GOOD3. hostname is set to", f.Machine.Hostname) - - check := new(zoopb.Machine) - check.Unmarshal(msg) - if check == nil { - log.Info("WTF. check == nil") - } - log.Info("good? check.hostname =", check.Hostname) - return f.HttpPost(url, msg) -} -*/ - func (f *Forge) HttpPost(url string, data []byte) ([]byte, error) { var err error var req *http.Request @@ -50,13 +20,6 @@ func (f *Forge) HttpPost(url string, data []byte) ([]byte, error) { usr, _ := user.Current() req.Header.Set("author", usr.Username) - /* - if f.Machine == nil { - // run f.InitMachine() here? - log.Info("you must run f.InitMachine()") - return nil, fmt.Errorf("you must run f.InitMachine()") - } - */ req.Header.Set("hostname", "fixme:hostname") client := &http.Client{} -- cgit v1.2.3