From bd29ab4612051978ce8dcb9d3a052208e03663dc Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 3 Mar 2024 07:38:34 -0500 Subject: [PATCH] fix: if we are being requested the root while is a dot, create a file based on the root cid with the . name --- api/s5/fs_webapp.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/s5/fs_webapp.go b/api/s5/fs_webapp.go index 712f7ca..46941d7 100644 --- a/api/s5/fs_webapp.go +++ b/api/s5/fs_webapp.go @@ -32,9 +32,17 @@ func (w webAppFs) Open(name string) (fs.File, error) { return nil, errors.New("manifest is not a web app") } + if name == "." { + return w.s5.newFile(FileParams{ + Hash: w.root.Hash.HashBytes(), + Type: w.root.Type, + Name: name, + }), nil + } + item, ok := webApp.Paths.Get(name) - if !ok && name != "/" && name != "." { + if !ok { return nil, fs.ErrNotExist } return w.s5.newFile(FileParams{