Problem/Motivation

When using 3rd party SDKs like the MCP SDK, there may be PSR-7 streamed responses.

\Drupal\Core\EventSubscriber\PsrResponseSubscriber always calls \Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface::createResponse with streamed as false.

Steps to reproduce

Return a PSR-7 \Psr\Http\Message\StreamInterface response from a controller. It doesn't respond correctly.

Proposed resolution

Add `instanceof \Psr\Http\Message\StreamInterface`

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3588331

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, tests are relying on the mock expectations rather than being an integration test but I think that's ok

alexpott’s picture

Version: main » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 88b77e6 and pushed to main. Thanks!

Committed and pushed 91e90273d5a to 11.x and href="https://git.drupalcode.org/project/drupal/commit/81f510bf6ce">81f510bf6ce to 11.3.x. Thanks!

Backported to 11.3.x after resolving conflicts and running tests locally.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 81f510bf on 11.3.x
    fix: #3588331 PsrResponseSubscriber doesn't support \Psr\Http\Message\...

  • alexpott committed 91e90273 on 11.x
    fix: #3588331 PsrResponseSubscriber doesn't support \Psr\Http\Message\...

  • alexpott committed 88b77e67 on main
    fix: #3588331 PsrResponseSubscriber doesn't support \Psr\Http\Message\...
mglaman’s picture

Issue tags: +MidCamp2026