Skip to content

fs: fix GenerateIndexPages when DirFS or embed.FS is used#1778

Merged
erikdubbelboer merged 1 commit intovalyala:masterfrom
efectn-forks:fs-fs-generateindex
May 18, 2024
Merged

fs: fix GenerateIndexPages when DirFS or embed.FS is used#1778
erikdubbelboer merged 1 commit intovalyala:masterfrom
efectn-forks:fs-fs-generateindex

Conversation

@efectn
Copy link
Contributor

@efectn efectn commented May 17, 2024

In current implementation of Fasthttp FS, GenerateIndexPages doesn't work properly with DirFS or embed.FS because of fs.ValidPath function.

When you open "" path using with DirFS it returns invalid path error. When using embed.FS, it returns file does not exist error.

So, if the path is "" both cases need to covered properly.

Note: I ain't also sure this is a good solution. Perhaps need smarter solution to cover more edge cases.

@erikdubbelboer erikdubbelboer merged commit aadadb9 into valyala:master May 18, 2024
@erikdubbelboer
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants