small fry

This commit is contained in:
Alexander Wang 2022-11-29 08:40:05 -08:00
parent 9ad44bdec0
commit 9259079d61
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
3 changed files with 3 additions and 4 deletions

View file

@ -8,7 +8,7 @@
#### Improvements 🔧
- Local images can now be included, e.g. `icon: ./my_img.png`.
[#146](https://github.com/terrastruct/d2/issues/146)
[#146](https://github.com/terrastruct/d2/issues/146)
#### Bugfixes 🔴

View file

@ -68,7 +68,7 @@ func inline(ms *xmain.State, in []byte, isRemote bool) ([]byte, error) {
return
}
if resp.err != nil {
ms.Log.Error.Printf("image failed to fetch: %s", resp.err.Error())
ms.Log.Error.Printf("image failed to fetch: %v", resp.err)
} else {
svg = strings.Replace(svg, resp.srctxt, fmt.Sprintf(`<image href="%s"`, resp.data), 1)
}
@ -88,7 +88,6 @@ var transport = http.DefaultTransport
func fetch(ctx context.Context, srctxt, href string, respChan chan resp) {
req, err := http.NewRequestWithContext(ctx, "GET", href, nil)
if err != nil {
respChan <- resp{err: err}
return
}

View file

@ -88,7 +88,7 @@ width="328" height="587" viewBox="-100 -131 328 587"><style type="text/css">
case pngURL:
body = string(testPNGFile)
default:
t.Fatal(req.URL.String())
t.Fatal(req.URL)
}
return &http.Response{
StatusCode: 200,