1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 22:14:45 -04:00

Web API: send API documentation if path is invalid

This commit is contained in:
f4exb
2017-11-20 18:38:26 +01:00
parent 7fa26835bd
commit 1b5f944302
9 changed files with 9091 additions and 5 deletions
+9 -2
View File
@@ -61,7 +61,13 @@ StaticFileController::StaticFileController(const HttpDocrootSettings& settings,
void StaticFileController::service(HttpRequest& request, HttpResponse& response)
{
QByteArray path=request.getPath();
QByteArray path = request.getPath();
service(path, response);
}
void StaticFileController::service(QByteArray& path, HttpResponse& response)
{
//QByteArray path=request.getPath();
// Check if we have the file in cache
qint64 now=QDateTime::currentMSecsSinceEpoch();
mutex.lock();
@@ -114,7 +120,8 @@ void StaticFileController::service(HttpRequest& request, HttpResponse& response)
entry->created=now;
entry->filename=path;
mutex.lock();
cache.insert(request.getPath(),entry,entry->document.size());
//cache.insert(request.getPath(),entry,entry->document.size());
cache.insert(path,entry,entry->document.size());
mutex.unlock();
}
else