diff options
author | rustyx <me@rustyx.org> | 2019-09-01 00:03:59 +0200 |
---|---|---|
committer | rustyx <me@rustyx.org> | 2019-09-21 10:37:17 +0200 |
commit | 512f61735eccd4dbf3df3b82bcd621aa721c23a7 (patch) | |
tree | 31c42c9058c049ee84a8c33d2e5b798ff9555849 /lib/libUPnP | |
parent | 35e6ca1d23177e138f2c57fad9839cc0e6682f16 (diff) |
fixed: make archive files work via UPnP
Diffstat (limited to 'lib/libUPnP')
-rw-r--r-- | lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp index 3d9180c6a3..2557f62851 100644 --- a/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp +++ b/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp @@ -190,8 +190,7 @@ PLT_HttpServer::ServeFile(const NPT_HttpRequest& request, NPT_FileInfo file_info; // prevent hackers from accessing files outside of our root - if ((file_path.Find("/..") >= 0) || (file_path.Find("\\..") >= 0) || - NPT_FAILED(NPT_File::GetInfo(file_path, &file_info))) { + if ((file_path.Find("/..") >= 0) || (file_path.Find("\\..") >= 0)) { return NPT_ERROR_NO_SUCH_ITEM; } @@ -201,7 +200,8 @@ PLT_HttpServer::ServeFile(const NPT_HttpRequest& request, // handle potential 304 only if range header not set NPT_DateTime date; NPT_TimeStamp timestamp; - if (NPT_SUCCEEDED(PLT_UPnPMessageHelper::GetIfModifiedSince((NPT_HttpMessage&)request, date)) && + if (NPT_SUCCEEDED(NPT_File::GetInfo(file_path, &file_info)) && + NPT_SUCCEEDED(PLT_UPnPMessageHelper::GetIfModifiedSince((NPT_HttpMessage&)request, date)) && !range_spec) { date.ToTimeStamp(timestamp); |