Closed
Description
Symfony version(s) affected
4.4.x
Description
The header data (Date, Message-ID, Content-Type) displayed in the Profiler is not the one of the sent message, but is refreshed each time the profiler page is reloaded.
You can see here each time I refresh the profiler page, the Header data is modified. It's not the case with Swiftmailer profile.
After page refresh the profiler tab:
The issue is related to the following code (getPreparedHeaders):
<div class="tab">
<h3 class="tab-title">Raw</h3>
<div class="tab-content">
<pre class="prewrap" style="max-height: 600px">{{ message.toString() }}</pre>
</div>
</div>
public function toString(): string
{
if (null === $body = $this->getBody()) {
$body = new TextPart('');
}
return $this->getPreparedHeaders()->toString().$body->toString();
}
How to reproduce
Send an email, go to the profiler page and refresh the profiler.
Check that headers change (Date takes the current datetime)
Possible Solution
No response
Additional Context
No response