When action=raw has been introduced, there was no content model available; every page was regarded as wikitext. It has been necessary to provide ctype= and require explicitly JavaScript or CSS resources.
Nowadays, we do know the content model of a page and if action=raw is requested and no ctype= is given in URL and content model is suggesting a MIME type like text/javascript or text/css or others, the answer should set appropriate Content-Type, otherwise text/x-wiki as practised by our forefathers.