-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: respondNoContent() returns Kint script in development mode #7347
Conversation
Thank you. You need GPG sign all your commits. Can you write test code to prove the bug fix? |
We do not use And please sign all your commits. |
is it correct now? |
Good! Thank you. |
I add content type checking on unit test, to make sure it returns non-HTML format, public function testNoContent()
{
$controller = $this->makeController();
$this->invoke($controller, 'respondNoContent', ['']);
$this->assertStringStartsWith('application/json', $this->response->getHeaderLine('Content-Type'));
$this->assertSame('No Content', $this->response->getReason());
$this->assertSame(204, $this->response->getStatusCode());
} because in Toolbar.php it checks the type // Non-HTML formats should not include the debugbar
// then we send headers saying where to find the debug data
// for this response
if ($request->isAJAX() || strpos($format, 'html') === false) {
$response->setHeader('Debugbar-Time', "{$time}")
->setHeader('Debugbar-Link', site_url("?debugbar_time={$time}"));
return;
} |
Thank you! |
Description
Fixes #7346 about API\ResponseTrait::respondNoContent() returns Kint script in development mode.
Checklist: