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}`);