Remove the X-generator header from the response
The simplest method is to remove the header in a custom EventSubscriber:

$response-&gt;headers-&gt;remove('X-Generator');


See https://drupal.stackexchange.com/a/201297/47547 for an example.