Skip to content

Commit

Permalink
fix(gateway): correct symlink content type
Browse files Browse the repository at this point in the history
We should be _resolving_ symlinks (sometimes, still need to figure out when to
do this WRT IPNS). However, that's a larger feature.
  • Loading branch information
Stebalien committed Sep 26, 2019
1 parent 61fad42 commit 8c804aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ func (i *gatewayHandler) serveFile(w http.ResponseWriter, req *http.Request, nam
http.Error(w, fmt.Sprintf("foobar %T: %s", file, err), http.StatusBadGateway)
return
}
if _, isSymlink := file.(*files.Symlink); isSymlink {
// We should be smarter about resolving symlinks but this is the
// "most correct" we can be without doing that.
w.Header().Set("Content-Type", "inode/symlink")
}
http.ServeContent(w, req, name, modtime, &lazySeeker{
size: size,
reader: file,
Expand Down

0 comments on commit 8c804aa

Please sign in to comment.