From 3249a09d4239dbc7b5cbce53f611014d8c89b0d4 Mon Sep 17 00:00:00 2001 From: thlo Date: Thu, 27 Dec 2012 17:13:59 +0100 Subject: Allow fetching of widget.conf --- vdr-smarttvweb/httpresource.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vdr-smarttvweb/httpresource.c b/vdr-smarttvweb/httpresource.c index bd83d80..7755ff0 100644 --- a/vdr-smarttvweb/httpresource.c +++ b/vdr-smarttvweb/httpresource.c @@ -347,6 +347,14 @@ int cHttpResource::processRequest() { if (mPath.compare("/widget.conf") == 0) { mPath = mFactory->getConfigDir() + "/widget.conf"; + + if (stat(mPath.c_str(), &statbuf) < 0) { + sendError(404, "Not Found", NULL, "File not found."); + return OKAY; + } + mFileSize = statbuf.st_size; + mContentType = SINGLEFILE; + return sendFile(&statbuf); } if (mPath.size() > 8) { -- cgit v1.2.3