Multiresponse normalizer invalid headers "sub-content-type"

Created on 25 November 2019, almost 5 years ago
Updated 18 December 2023, 11 months ago

While using subrequests I consistently retrieve following notice "Notice: Undefined index: sub-content-type" which flushes the database.

It seems on the MultiresponseJsonNormalizer the sub-content-type is included in the headers but this is never set.

/**
 * Normalizes multiple response objects into a single string.
 */
class MultiresponseJsonNormalizer implements NormalizerInterface {

  /**
   * {@inheritdoc}
   */
  public function normalize($object, $format = NULL, array $context = []) {
    // Prepare the root content type header.
    $content_type = sprintf(
      'application/json; type=%s',
      $context['sub-content-type'],
    );
    $headers = ['Content-Type' => $content_type];

    ...

When checking existence before including this seems to be fixed. Should this be included in the first place and any idea's on why this is empty?

πŸ› Bug report
Status

Postponed: needs info

Version

2.2

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium smanhoff

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024