qhttpengine icon indicating copy to clipboard operation
qhttpengine copied to clipboard

add support for default-document

Open benadler opened this issue 6 years ago • 1 comments

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?

benadler avatar Aug 12 '19 10:08 benadler

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.

nathan-osman avatar Aug 14 '19 05:08 nathan-osman