Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpFoundation] Make makeDisposition static in ResponseHeaderBag #14504

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rijnhard opened this issue Apr 29, 2015 · 2 comments
Closed

[HttpFoundation] Make makeDisposition static in ResponseHeaderBag #14504

rijnhard opened this issue Apr 29, 2015 · 2 comments

Comments

@rijnhard
Copy link

I have now reached a use case where I have a class that acts a lot like StreamedResponse but has the purpose of handling the headers, status codes, and outputting of data before the Response object is generated.

The problem is that makeDisposition is not static (in the source there is no reference to any internal variables in makeDisposition in the ResponseHeaderBag) So I see no reason why it cannot be static.
It will also then allows us to use makeDisposition ahead of the response object creation and pass the header along. instead of setting it after creation.

@rijnhard rijnhard changed the title Make makeDisposition static in ResponseHeaderBag [HttpFoundation] Make makeDisposition static in ResponseHeaderBag Apr 29, 2015
@jakzal
Copy link
Contributor

jakzal commented May 11, 2015

Could you tell us more about what you're trying to do exactly? Once you start outputting, headers and content are usually known (even if content is being streamed you know the source).

We cannot make the method static as it would be a BC break.

@rijnhard
Copy link
Author

In my case i avoided the issue in the end. Since my initial attempt was wrong, unrelated to this.

And since this is a BC break, you can close the issue. Convenience is less important and since there is no active use case anymore there is no need for this.

I did make a factory that was creating response objects for me but needed to have some headers defined/determined before the response object was actually created.

A refactor had me remove all that logic, which to be honest was kind of nasty anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants