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

Skip to content

[WebProfiler] fix content-type parameter #8350

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
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ public function cssAction($token)
if (!$this->templateExists($template)) {
$handler = new ExceptionHandler();

return new Response($handler->getStylesheet($exception));
return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
}

return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, 'text/css');
return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css'));
}

protected function getTemplate()
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Response
*
* @api
*/
public function __construct($content = '', $status = 200, $headers = array())
public function __construct($content = '', $status = 200, array $headers = array())
Copy link
Member

Choose a reason for hiding this comment

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

This must be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why?

Copy link
Member

Choose a reason for hiding this comment

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

because this method is tagged with @api and because this change does not change anything and does not fix anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So would you accept it for master?

Copy link
Member

Choose a reason for hiding this comment

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

no

Copy link
Member

Choose a reason for hiding this comment

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

And last but not the least, it is not even related to the other change you made.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How it is breaking BC? And yes it is related because the bug would probably not have occured with this change because it would be obvious that you cannot pass a string where an array is expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

@fabpot It's not a real BC as it looks, php allows to change constructor behavior in extending classes, i.e.: http://3v4l.org/fB31K

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's one of the only changes that is NO BC BREAK at all. Most other changes, even simply adding a protected method to a class, can be considered bc break. But this not.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not going to change my mind.

{
$this->headers = new ResponseHeaderBag($headers);
$this->setContent($content);
Expand Down