diff options
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) |
