Hi there!
I’m having trouble with a simple fetch request to my custom backend. I added the trusted_domains entry in src/manifest.json, but I’m still getting a “refused to connect” error.
Do you know if I’m missing something? I’d appreciate any help.
Refused to connect to https://sh.example.com/api/products because it does not appear in the connect-src directive of the Content Security Policy.
{
"name": "example-mini-app",
"permissions": [],
"scopes": ["product_list:write"],
"trusted_domains": ["sh.example.com/api", "cdn.example.com"]
}
const BASE_URL = "https://sh.example.com";
const response = await fetch(
`${BASE_URL}/api/products`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
},
);