From 1bce06b615b44dbd5fd3d3c57d1ab6567451e680 Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 22 Jan 2025 22:11:53 +0100
Subject: feat: upstream links

---
 src/routes/canaries/+page.svelte | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'src/routes/canaries/+page.svelte')

diff --git a/src/routes/canaries/+page.svelte b/src/routes/canaries/+page.svelte
index 1613831..c03a764 100644
--- a/src/routes/canaries/+page.svelte
+++ b/src/routes/canaries/+page.svelte
@@ -20,14 +20,14 @@
           {#each canaries as canary}
             <li class="list-disc ml-4">
               {canary.signer}'s canary for {canary.name} (<a
-                href={canary.url}
+                href={canary.upstream ?? canary.url}
                 target="_blank"
                 download="{canary.signer}:{canary.name}.sig"
                 class="opacity-90 hover:underline text-blue-400 hover:text-blue-300"
                 >download</a
               >,
               <a
-                href={canary.url}
+                href={canary.upstream ?? canary.url}
                 target="_blank"
                 class="opacity-90 hover:underline text-blue-400 hover:text-blue-300"
                 >open in newtab</a
@@ -122,6 +122,16 @@
         found, it turns a different shade of
         <span class="bg-red-800 text-white">red</span>.</span
       >
+      {#if canaries.find((v) => v.upstream)}
+        <span
+          class="upstream-btn opacity-60 hover:opacity-80 transition-all"
+          class:hidden={!browser}
+          ><br />
+          If there is an upstream button, it indicates that we are mirroring the
+          canary, rather than using the source canary, e.g. for CORS. You may want
+          to check it in the event of something looking wrong.</span
+        >
+      {/if}
     </p>
   </div>
 </div>
-- 
cgit v1.2.3

