Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iis/mymodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
}

REQUEST_NOTIFICATION_STATUS
CMyHttpModule::OnBeginRequest(

Check failure on line 718 in iis/mymodule.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 45 to the 25 allowed.

See more on https://sonarcloud.io/project/issues?id=owasp-modsecurity_ModSecurity&issues=AaBCZ0zJ6193acJ4eyu-&open=AaBCZ0zJ6193acJ4eyu-&pullRequest=3622
IN IHttpContext * pHttpContext,
IN IHttpEventProvider * pProvider
)
Expand Down Expand Up @@ -840,7 +840,7 @@
r->hostname = ConvertUTF16ToUTF8(req->CookedUrl.pHost, req->CookedUrl.HostLength / sizeof(WCHAR), r->pool);
r->path_info = ConvertUTF16ToUTF8(req->CookedUrl.pAbsPath, req->CookedUrl.AbsPathLength / sizeof(WCHAR), r->pool);

if(r->hostname == NULL)
if(r->hostname == NULL || r->hostname[0] == '\0')
{
if(req->Headers.KnownHeaders[HttpHeaderHost].pRawValue != NULL)
r->hostname = ZeroTerminate(req->Headers.KnownHeaders[HttpHeaderHost].pRawValue,
Expand Down
Loading