提交 115dc97f 作者: Steven Allen

fix(gateway): correct symlink content type

We should be _resolving_ symlinks (sometimes, still need to figure out when to
do this WRT IPNS). However, that's a larger feature.
上级 c228d72f
......@@ -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,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论