Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Implement content-type whitelist for CWebLogRoute #2165
As long as I can remember, CWebLogRoute (and its derived classes like CProfileLogRoute) causes problems when generating non-html output. Most often, it seems to break ajax calls that are meant to return json data, but it really affects everything that is not html.
One solution might be to implement a content-type whitelist. With this feature, the logroute should only generate output, if the application generated content, that is whitelisted. Then, when a developer generates json data, or xml, or returns a generated image, that content would not be found on the whitelist and the output wouldn't be messed up with the html generated by the web log route (given the developer set a content-type header for his data).
As a reference, take a look at yii-debug-toolbar, which implements such a whitelist: