Skip to content

Commit

Permalink
Bugfix: HTTP header assignment operator didn't clear the headers befo…
Browse files Browse the repository at this point in the history
…re appending.
  • Loading branch information
BlueAndi committed Dec 5, 2023
1 parent 545218f commit 76c3ac2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/AsyncHttpClient/src/HttpResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ HttpResponse& HttpResponse::operator=(const HttpResponse& rsp)
m_statusCode = rsp.m_statusCode;
m_reasonPhrase = rsp.m_reasonPhrase;

if (nullptr != m_payload)
{
delete[] m_payload;
}
clearPayload();

if (nullptr != rsp.m_payload)
{
Expand All @@ -91,6 +88,8 @@ HttpResponse& HttpResponse::operator=(const HttpResponse& rsp)
}
}

clearHeaders();

if (true == it.first())
{
do
Expand Down

0 comments on commit 76c3ac2

Please sign in to comment.