You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
rijnhard
changed the title
Make makeDisposition static in ResponseHeaderBag
[HttpFoundation] Make makeDisposition static in ResponseHeaderBag
Apr 29, 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.
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.
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 theResponse
object is generated.The problem is that
makeDisposition
is not static (in the source there is no reference to any internal variables inmakeDisposition
in theResponseHeaderBag
) 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.The text was updated successfully, but these errors were encountered: