Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Looking at the generated doc here, the example shown for a header is nested one level too deep in the array
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...
It should either be written as one of these (they differ only by formatting):
$build['#attached']['http_header'][] = ['Content-Type', 'application/rss+xml; charset=utf-8'];
or
$build['#attached']['http_header'] = [
['Content-Type', 'application/rss+xml; charset=utf-8'],
];
Comment | File | Size | Author |
---|---|---|---|
#2 | 2763539-2.patch | 624 bytes | felribeiro |
Comments
Comment #2
felribeiro CreditAttribution: felribeiro at CI&T commentedComment #3
pwolanin CreditAttribution: pwolanin as a volunteer commentedComment #6
xjmGood catch! Committed f9ef1f6 and pushed to 8.2.x and 8.1.x. Thanks!