Merge pull request #6174 from Icinga/fix/api-crash-no-headeralloworigin

Fix crash without CORS setting
This commit is contained in:
Michael Friedrich 2018-03-21 20:50:48 +01:00 committed by GitHub
commit 0d3a04cf92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ bool HttpServerConnection::ManageHeaders(HttpResponse& response)
Array::Ptr headerAllowOrigin = listener->GetAccessControlAllowOrigin();
if (headerAllowOrigin->GetLength() != 0) {
if (headerAllowOrigin && headerAllowOrigin->GetLength() != 0) {
String origin = m_CurrentRequest.Headers->Get("origin");
{
ObjectLock olock(headerAllowOrigin);