Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Fix missing Request in RequestStack for StreamedResponse#51396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?6.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#46743
LicenseMIT
Doc PR-

Similar to#51139 by@DaDeather, see discussion there.

pableu reacted with heart emoji
Copy link
Contributor

@alexander-schranzalexander-schranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks fine from my side.

@nicolas-grekas
Copy link
MemberAuthor

Thank you Ismail Turan.

@nicolas-grekasnicolas-grekas merged commita3e9a00 intosymfony:6.3Aug 16, 2023
@DaDeather
Copy link
Contributor

Thank you Ismail Turan.

Sure happy to help!
But more important thank you guys for your effort 😀!

derrabus reacted with heart emoji

@nicolas-grekasnicolas-grekas deleted the DaDeather/fix-httpkernel-issue-46743 branchAugust 23, 2023 16:56
@fabpotfabpot mentioned this pull requestAug 26, 2023
nicolas-grekas added a commit that referenced this pull requestOct 12, 2023
…` (elementaire)This PR was merged into the 6.3 branch.Discussion----------[HttpKernel] Handle nullable callback of `StreamedResponse`| Q             | A| ------------- | ---| Branch?       | 6.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |  -| License       | MITThis PR fixes a bug introduced by#51396. Having a callback in `StreamResponsed` is not a mandatory by design.So the method `getCallback` must check it like `sendContent` does.When we are dealing with cacheable ressource, only headers are sent from `StreamResponsed`, for example:```php#[Route(path: '/download')]public function download(Request $request): StreamedResponse{    // Get the last modified of a file.    $lastModified = \DateTime::createFromFormat('d/m/Y H:i:s', '10/10/2023 13:22:00');    $response = (new StreamedResponse())->setLastModified($lastModified);    if ($response->isNotModified($request)) {        return $response;    }    // Get the stream of a file and attach it to the callback.    // ...    return $response;}````HttpKernel` class have to handle it else if you obtain `HTTP 500` with message `Value of type null is not callable`.cc `@nicolas`-grekasCommits-------66648c5 [HttpKernel] Handle nullable callback of StreamedResponse
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus approved these changes

+1 more reviewer

@alexander-schranzalexander-schranzalexander-schranz approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@DaDeather@derrabus@alexander-schranz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp