From 0f67d030cfa6536994a84092ac295b90033a64a1 Mon Sep 17 00:00:00 2001 From: FernandoJVideira <03.pleaser-minster@icloud.com> Date: Fri, 1 Aug 2025 02:01:30 +0100 Subject: [PATCH] Referer Fix --- src/components/NameGeneratorCard.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/NameGeneratorCard.vue b/src/components/NameGeneratorCard.vue index 5297692..6e9a27f 100644 --- a/src/components/NameGeneratorCard.vue +++ b/src/components/NameGeneratorCard.vue @@ -222,7 +222,13 @@ async function generate() { if (modern.value) { // Use API for modern names const url = `https://namegen.fernandovideira.com/v1/modern/${language.value}?gender=${gender.value}`; - const response = await fetch(url); + const response = await fetch(url, { + method: "GET", + headers: { + Referer: window.location.href, + Origin: window.location.origin, + }, + }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); @@ -247,7 +253,13 @@ async function generate() { } else { // Use API for fantasy names const url = `https://namegen.fernandovideira.com/v1/fantasy/${race.value}-names?gender=${gender.value}`; - const response = await fetch(url); + const response = await fetch(url, { + method: "GET", + headers: { + Referer: window.location.href, + Origin: window.location.origin, + }, + }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`);