Fixed the content-type detection for the stat endpoint.