Web API: resources and static file controller updates

This commit is contained in:
f4exb 2017-11-22 00:28:26 +01:00
parent cf2f099c37
commit e7dc0f9b53
3 changed files with 8 additions and 1 deletions

View File

@ -143,6 +143,7 @@ void StaticFileController::service(QByteArray& path, HttpResponse& response)
}
else
{
qWarning("StaticFileController: File %s not found",qPrintable(file.fileName()));
response.setStatus(404,"not found");
response.write("404 not found",true);
}

View File

@ -16,6 +16,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
//#include <QDirIterator>
#include "httpdocrootsettings.h"
#include "webapirequestmapper.h"
#include "SWGInstanceSummaryResponse.h"
@ -71,6 +73,11 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
}
else
{
// QDirIterator it(":", QDirIterator::Subdirectories);
// while (it.hasNext()) {
// qDebug() << "WebAPIRequestMapper::service: " << it.next();
// }
QByteArray path = "/index.html";
m_staticFileController->service(path, response);
//response.setStatus(404,"Not found");

View File

@ -5,7 +5,6 @@
<file>microphone.png</file>
<file>checkmark.png</file>
<file>questionmark.png</file>
<file>res.qrc</file>
<file>export.png</file>
<file>import.png</file>
<file>compressed.png</file>