Skip to content

Commit

Permalink
[WebServer] Update Normalize() call after core changes (#835)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Wielders <[email protected]>
  • Loading branch information
sebaszm and pwielders authored Oct 9, 2024
1 parent 8394060 commit a4903f9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions WebServer/WebServerImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,16 +844,14 @@ POP_WARNING()
{
TRACE(WebFlow, (request));

bool safePath = true;

string realPath = Core::File::Normalize(request->Path, safePath);
if (safePath == true) {
const string realPath = Core::File::Normalize(request->Path, true /* safe path */);
if (realPath.empty() == false) {
// Use Normalized Path
request->Path = realPath;
}

// Check if the channel server will relay this message.
if (safePath == false) {
if (realPath.empty() == true) {
Core::ProxyType<Web::Response> response(PluginHost::IFactories::Instance().Response());
response->ErrorCode = Web::STATUS_BAD_REQUEST;
response->Message = "Invalid Request";
Expand Down

0 comments on commit a4903f9

Please sign in to comment.