From 2fcbdff3c120fad3472e4d352f4f0f4ac15bea4a Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Date: Fri, 13 Oct 2023 20:01:49 -0400
Subject: [PATCH] Made it so activity and status endpoints return correct
 content-type

---
 CHANGELOG.md               |  2 ++
 layouts/partials/head.html |  2 +-
 vercel.json                | 22 ++++++++++++++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c994ce827..abad28101 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,8 @@
     setup it will now default to a generic avatar rather than render text.
 * Removed image alt text when rendering page comments. If an image profile link
     wqs broken the rendered text would not look right.
+* The `activity` and `status` endpoints, when called with no extension, now
+    return the correct `content-type` in header.
 
 ## 1.0.1
 
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 0c642708b..487822eb7 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -18,7 +18,7 @@
   <meta name="theme-color" content="{{ if .Params.themecolor }}#{{ .Params.themecolor}}{{ else }}#000000{{ end }}">
 
   {{ if (and .Permalink (not .IsHome)) }}
-    <link href="{{ .Permalink | safeURL }}status.ajson" rel='alternate' type='application/activity+json'>
+    <link href="{{ .Permalink | safeURL }}status" rel='alternate' type='application/activity+json'>
   {{end}}
 
   <meta property="og:site_name" content="{{ site.Params.siteName }}">
diff --git a/vercel.json b/vercel.json
index 2f4c40ccc..635990657 100644
--- a/vercel.json
+++ b/vercel.json
@@ -58,6 +58,10 @@
       "source": "/([^/]*)/(.*)/activity",
       "destination": "/$1/$2/activity.ajson"
     },
+    {
+      "source": "/([^/]*)/(.*)/status",
+      "destination": "/$1/$2/status.ajson"
+    },
     {
       "source": "/.well-known/(.*)",
       "destination": "/api/well-known/$1"
@@ -155,6 +159,24 @@
         }
       ]
     },
+    {
+      "source": "/([^/]*)/(.*)/activity",
+      "headers": [
+        {
+          "key": "content-type",
+          "value": "application/activity+json"
+        }
+      ]
+    },
+    {
+      "source": "/([^/]*)/(.*)/status",
+      "headers": [
+        {
+          "key": "content-type",
+          "value": "application/activity+json"
+        }
+      ]
+    },
     {
       "source": "/(.*).ajson",
       "headers": [
-- 
GitLab