CSP error: Refused to connect to an API because of connect-src

The page tried to open a connection that connect-src or its fallback did not allow. Find the destination in the Console violation. It can be a Fetch or XHR request, a WebSocket or an event stream, so check the protocol as well as the host.
Inspect the policy returned with the page making the request. For a trusted API or socket, allow the destination with its actual scheme, host and port.
Content-Security-Policy: default-src 'self'; connect-src 'self' https://api.example.com
Once the policy permits the connection, Network can show a separate API response or a failed WebSocket handshake. Use that evidence to debug the endpoint after the browser has let the request start.
Compare the destination in Console with the deployed connect-src policy, including the scheme and port.