“js” is not a registered media type #539

foreignfilm opened this Issue Jun 14, 2012 · 1 comment


None yet
2 participants

Trying to render the output as JavaScript (which is essentially plain text but with the "text/javascript" header) results in an Unhandled media type error. Apparently, the “js” media type is not fully registered in the /lithium/net/http/Media.php file, although it’s present there in the code.

// This doesn’t work
return $this->render(array('js' => $js_code));

A temporary solution is to register the “js” media type manually in /config/bootstrap/media.php (see Handler registration here). But since “js” is already there in the source code as one of the default media types, would be good to have it working out of the box.


gwoo commented May 5, 2013

js is there for a convenience when defining it on your own. Same is the case for xml.

gwoo closed this May 5, 2013

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