Skip to content

Commit

Permalink
gateway: make serving index.html a little more efficient
Browse files Browse the repository at this point in the history
Prevents unneccessary conversions and lookups :):)

License: MIT
Signed-off-by: Lars Gierth <[email protected]>
  • Loading branch information
Lars Gierth committed Dec 9, 2016
1 parent 2e15ba9 commit 7241c02
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,8 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
return
}

p, err := path.ParsePath(urlPath + "/index.html")
if err != nil {
internalWebError(w, err)
return
}

// return index page instead.
dr, err := i.api.Unixfs().Cat(ctx, p.String())
dr, err := i.api.Unixfs().Cat(ctx, link.Cid)
if err != nil {
internalWebError(w, err)
return
Expand Down

0 comments on commit 7241c02

Please sign in to comment.