Custom WP rest api endpoint only working on non https?

Custom WP rest api endpoint only working on non https?