Ah, that works, but this doesn't:
<!-- Save this as test-cors.html and open in a browser -->
<!DOCTYPE html>
<html>
<body>
<script>
fetch("https://piefed.social/comment/6527914", {
method: "GET", // or "POST", etc.
headers: {
"Content-Type": "application/json",
Accept: "application/activity+json",
},
})
.then((response) => response.text())
.then((data) => console.log("Success:", data))
.catch((error) => console.error("CORS Error:", error));
</script>
</body>
</html>
nor this:
<!-- Save this as test-cors.html and open in a browser -->
<!DOCTYPE html>
<html>
<body>
<script>
fetch("https://piefed.social/.well-known/nodeinfo", {
method: "GET", // or "POST", etc.
headers: {
"Content-Type": "application/json"
},
})
.then((response) => response.text())
.then((data) => console.log("Success:", data))
.catch((error) => console.error("CORS Error:", error));
</script>
</body>
</html>