35

Not sure where to post this: the Piefed API doesn't support CORS, at least testing against piefed.social, so requests from webapps like photon, alexandrite, voyager via PWA would not work.

Also, is there a way to pass a fedilink to resolve, like Lemmy resolveObject?

And lastly, how is Piefed planning on handling updates to the API for lemmy v1? Things like varying object type arrays being combined, and new/updated sorts.

Thanks!

all 11 comments
sorted by: hot top new old
[-] rimu@piefed.social 12 points 2 years ago
[-] aeharding@vger.social 5 points 2 years ago

Nice, thanks! I’ll try it again soon

[-] aeharding@vger.social 3 points 2 years ago

I checked piefed.social and I'm still getting CORS errors. Does the change still have yet to be deployed there?

[-] rimu@piefed.social 3 points 2 years ago

It's working for me. Try this:

<!-- Save this as test-cors.html and open in a browser -->
<!DOCTYPE html>
<html>
  <body>
    <script>
      fetch("https://piefed.social/api/alpha/comment?id=6527216", {
        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>
[-] aeharding@vger.social 3 points 2 years ago* (last edited 2 years ago)

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>
[-] rimu@piefed.social 3 points 2 years ago

Ok technically those are not part of the API ;-)

I've put CORS headers on everything now, go for it.

[-] keepthepace@slrpnk.net 2 points 2 years ago* (last edited 2 years ago)
[-] Blaze@piefed.social 1 points 2 years ago

@aeharding@vger.social test

[-] wjs018@piefed.social 9 points 2 years ago

Also, is there a way to pass a fedilink to resolve, like Lemmy resolveObject?

I don't think so yet...I think this issue is tracking it.

I can't really help with the others, but you might want to hop on the piefed matrix chat (#piefed-general:matrix.org). @rimu@piefed.social hangs out there and would have much better answers (during kiwi hours anyway).

[-] Blaze@piefed.social 2 points 2 years ago

@aeharding@vger.social test

this post was submitted on 10 Jun 2025
35 points (100.0% liked)

PieFed Meta

5158 readers
30 users here now

Discuss PieFed project direction, provide feedback, ask questions, suggest improvements, and engage in conversations related to the platform organization, policies, features, and community dynamics.

Wiki

founded 2 years ago
MODERATORS