From 038d3620d2995e8aa41b5c84f89d13b8045452a5 Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Date: Tue, 17 Oct 2023 13:03:53 -0400
Subject: [PATCH] Added gitlab heatmap support

---
 layouts/partials/head.html |  4 ++--
 vercel.json                | 21 ++++++++++++++++-----
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 6dc9f6865..f5a71dd8c 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -191,8 +191,8 @@ document.addEventListener("DOMContentLoaded", function() {
   var getJSON = function(url, callback) {
       var xhr = new XMLHttpRequest();
       xhr.open('GET', url, false);
-      xhr.setRequestHeader("Accept", 'application/json');
-      xhr.setRequestHeader("Access-Control-Allow-Origin", '*');
+      xhr.setRequestHeader("content-type", "application/json");
+      xhr.setRequestHeader("Accept", "application/json");
       xhr.send();
       return xhr.response
   };
diff --git a/vercel.json b/vercel.json
index 0fd58817a..28ba32f39 100644
--- a/vercel.json
+++ b/vercel.json
@@ -106,12 +106,23 @@
   },
   "headers": [
     {
-      "source": ".*",
+      "source": "(.*)",
       "headers": [
-        {
-          "key": "Access-Control-Allow-Origin",
-          "value": "*"
-        }
+        { "key": "Access-Control-Allow-Credentials", "value": "true" },
+        { "key": "Access-Control-Allow-Origin", "value": "*" },
+        { "key": "Access-Control-Allow-Methods", "value": "*" },
+        { "key": "Access-Control-Expose-Headers", "value": "*" },
+        { "key": "Access-Control-Expose-Headers", "value": "*" }
+      ]
+    },
+    {
+      "source": "/",
+      "headers": [
+        { "key": "Access-Control-Allow-Credentials", "value": "true" },
+        { "key": "Access-Control-Allow-Origin", "value": "*" },
+        { "key": "Access-Control-Allow-Methods", "value": "*" },
+        { "key": "Access-Control-Expose-Headers", "value": "*" },
+        { "key": "Access-Control-Allow-Headers", "value": "*" }
       ]
     },
     {
-- 
GitLab