From 6e2925d8421cb3bee8ee8ad95c4737f35baf91cf Mon Sep 17 00:00:00 2001 From: Melanie Seltzer Date: Thu, 3 Oct 2019 23:18:26 -0700 Subject: [PATCH] Dedupe meta tag in favor of custom tag defined in _app --- packages/next/next-server/lib/head.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/next/next-server/lib/head.tsx b/packages/next/next-server/lib/head.tsx index bd5e6e7e78da1..bee5242e0c3b1 100644 --- a/packages/next/next-server/lib/head.tsx +++ b/packages/next/next-server/lib/head.tsx @@ -72,6 +72,12 @@ function unique() { keys.add(h.key) return true } + + // If custom meta tag has been added the key will be prepended with `.$`, we can + // check for this and dedupe in favor of the custom one, so the default + // is not rendered as well + if (keys.has(`.$${h.key}`)) return false + switch (h.type) { case 'title': case 'base':