def handler(request):
    """Handler for a file:// URL.

    Args:
        request: QNetworkRequest to answer to.

    Return:
        A QNetworkReply for directories, None for files.
    """
    path = request.url().toLocalFile()
    try:
        if os.path.isdir(path):
            data = dirbrowser_html(path)
            return networkreply.FixedDataNetworkReply(
                request, data, 'text/html')
        return None
    except UnicodeEncodeError:
        return None
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.