Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for default-document #31

Open
benadler opened this issue Aug 12, 2019 · 1 comment
Open

add support for default-document #31

benadler opened this issue Aug 12, 2019 · 1 comment

Comments

@benadler
Copy link

When using the FilesystemHandler, I get directory listings even when a directory contains an index.html. So I patched filesystemhandler.cpp like this:

void FilesystemHandlerPrivate::processDirectory(Socket *socket, const QString &path, const QString &absolutePath) {

    // if there's an index.html, use it instead!
    const QFileInfo index(absolutePath + "/index.html");
    if (index.exists()) {
        processFile(socket, index.absoluteFilePath());
        return;
    }

    // Add entries for each of the files
    QString listing;
    ....

Is that useful? Or does the API already support this, and I missed that?

@nathan-osman
Copy link
Member

This is by design, since it would otherwise become impossible to view directory listings for and directory with an index.html file present.

That being said, I understand why this would be useful and I would certainly support adding this feature to FilesystemHandler provided that it was a configurable option.

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

No branches or pull requests

2 participants