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'],
];
CommentFileSizeAuthor
#2 2763539-2.patch624 bytesfelribeiro
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin created an issue. See original summary.

felribeiro’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
624 bytes
pwolanin’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

  • xjm committed f9ef1f6 on 8.1.x
    Issue #2763539 by felribeiro: Bug in doxygen for adding headers to a...

  • xjm committed 52cd7e9 on 8.2.x
    Issue #2763539 by felribeiro: Bug in doxygen for adding headers to a...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Good catch! Committed f9ef1f6 and pushed to 8.2.x and 8.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.