diff options
| author | Jeff Carr <[email protected]> | 2025-02-22 06:53:42 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-22 06:53:42 -0600 |
| commit | f540aab43407a50477c8b25af8ba125dcc5c6be6 (patch) | |
| tree | ffa6a52593b30122053bf8d4d6a372b2f9667870 /http.go | |
| parent | a170250cb4e44b87641b2a3b7a36afec3bfab741 (diff) | |
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -4,15 +4,14 @@ package forgepb import ( "bytes" - "fmt" "io/ioutil" "net/http" "os/user" - "go.wit.com/lib/protobuf/zoopb" "go.wit.com/log" ) +/* func (f *Forge) HttpPostMachine(url string) ([]byte, error) { if f.Machine == nil { // run f.InitMachine() here? @@ -40,6 +39,7 @@ func (f *Forge) HttpPostMachine(url string) ([]byte, error) { 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 @@ -50,12 +50,14 @@ 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", f.Machine.Hostname) + /* + 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{} resp, err := client.Do(req) |
