Set cc_type server-side in case of js failure

Fixes #3918