    def get_current_user_cookie(self):
        """Extend get_user_cookie to add checks for CORS"""
        cookie_user = super().get_current_user_cookie()
        # CORS checks for cookie-authentication
        # check these only if there is a cookie user,
        # avoiding misleading "Blocking Cross Origin" messages
        # when there's no cookie set anyway.
        if cookie_user:
            if (
                self.request.method.upper() == 'POST'
                and not self.check_post_content_type()
            ):
                return None
        return cookie_user
Extend get_user_cookie to add checks for CORS
jupyterhub/apihandlers/base.py