EmissarySocial / emissary

The Social Web Toolkit
https://emissary.dev
GNU Affero General Public License v3.0
132 stars 14 forks source link

Getting the RSS/Atom feed gives the whole HTML page #441

Closed dolanor closed 2 months ago

dolanor commented 3 months ago
curl http://localhost:7777/@66815fbbab4920c2d1b2c2c6/feed?format=atom

Gives me

<!doctype html><html><head><title>localhost | Admin</title>
<link rel="webmention" href="/.webmention"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="generator" content="https://emissary.social"><link rel="stylesheet" href="/.themes/global/resources/bootstrap-icons-1.11.3/font/bootstrap-icons.css" rel="preload"><link rel="stylesheet" href="/.themes/global/stylesheet" rel="preload"><link rel="stylesheet" href="/.themes/default/stylesheet" rel="preload"></head><body hx-target="main" hx-swap="innerHTML" hx-push-url="true" hx-ext="a11y"><nav hx-push-url="true"><div class="framed"><div class="left"><a href="/home" class="turboclick ">Welcome!</a><a href="/668164867572c048f006adca" class="turboclick ">Events</a></div><div class="right"><a href="/signin" class="turboclick">Sign In</a></div></div></nav><main><?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>Admin</title>
  <id>http://localhost:7777/@66815fbbab4920c2d1b2c2c6</id>
  <updated>2024-06-30T21:10:49Z</updated>
  <link href="http://localhost:7777/@66815fbbab4920c2d1b2c2c6"></link>
  <author></author>
  <entry>
    <title></title>
    <updated>2024-06-30T20:51:40Z</updated>
    <id>tag:localhost,2024-06-30:/6681c55c7572c048f006ae2e</id>
    <link href="http://localhost/6681c55c7572c048f006ae2e" rel="alternate"></link>
    <author>
      <name>Admin</name>
      <email>admin@localhost</email>
    </author>
  </entry>
  <entry>
    <title></title>
    <updated>2024-06-30T20:52:01Z</updated>
    <id>tag:localhost,2024-06-30:/6681c5707572c048f006ae3e</id>
    <content type="html">&lt;a href=&#34;https://hachyderm.io/users/dolanor&#34; target=&#34;_blank&#34;&gt;@dolanor@hachyderm.io&lt;/a&gt; are you here?&lt;br&gt;</content>
    <link href="http://localhost/6681c5707572c048f006ae3e" rel="alternate"></link>
    <author>
      <name>Admin</name>
      <email>admin@localhost</email>
    </author>
  </entry>
  <entry>
    <title>My album</title>
    <updated>2024-06-30T21:07:32Z</updated>
    <id>tag:localhost,2024-06-30:/6681c9147572c048f006aec8</id>
    <link href="http://localhost/6681c9147572c048f006aec8" rel="alternate"></link>
    <author>
      <name>Admin</name>
      <email>admin@localhost</email>
    </author>
  </entry>
  <entry>
    <title></title>
    <updated>2024-06-30T21:07:55Z</updated>
    <id>tag:localhost,2024-06-30:/6681c92b7572c048f006aed3</id>
    <link href="http://localhost/6681c92b7572c048f006aed3" rel="alternate"></link>
    <author>
      <name>Admin</name>
      <email>admin@localhost</email>
    </author>
  </entry>
</feed></main><aside></aside></body><script type="text/hyperscript" src="/.themes/global/hyperscript"></script><script src="/.themes/global/resources/htmx/htmx.min.js" rel="preload"></script><script src="/.themes/global/resources/hyperscript/_hyperscript.min.js" rel="preload"></script><script src="/.themes/global/javascript"></script></html>

I wonder if it's a Go template sending the whole page instead of just the Atom part.

Reminds me of an improvement I'm making in dolanor/rip where each entity returned the whole HTML page and not just the entity formatted in HTML.

benpate commented 2 months ago

Thank you for this! I believe I've gotten this straightened out with a recent commit

It should be on main right now :)