Ensure json metadata is retrieved for box
This commit is contained in:
parent
f97aff623f
commit
e27fb8aa07
@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
@ -155,7 +156,10 @@ func BoxWithBox(box *vagrant_server.Box) BoxOption {
|
||||
}
|
||||
|
||||
func (b *Box) loadMetadata() (metadata *BoxMetadata, err error) {
|
||||
resp, err := http.Get(b.box.MetadataUrl)
|
||||
client := &http.Client{}
|
||||
req, err := http.NewRequest("GET", fmt.Sprintf("%s.json", b.box.MetadataUrl), nil)
|
||||
req.Header.Add("Content-Type", "application/json")
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user