Skip to content

Commit

Permalink
added error check
Browse files Browse the repository at this point in the history
  • Loading branch information
10d9e committed Jun 8, 2023
1 parent 03e64fc commit 28fffc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func (gw *GatewayHandler) serveUnixfsDir(ctx context.Context, n mdagipld.Node, w
fmt.Fprintf(w, "<html><body><ul>")

requestURI, err := url.ParseRequestURI(req.RequestURI)
if err != nil {
return err
}

if err := dir.ForEachLink(ctx, func(lnk *mdagipld.Link) error {
href := gopath.Join(requestURI.Path, lnk.Name)
Expand Down

0 comments on commit 28fffc2

Please sign in to comment.