Skip to content

Commit

Permalink
try hard coded referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane98c committed Jan 7, 2025
1 parent 3c1eaf7 commit c28f784
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pages/api/og.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { postMetadata } from '../../utils/post-metadata'

export const runtime = 'edge'

const getFonts = async (origin) => {
const getFonts = async () => {
try {
const headers = new Headers({ Referer: origin })
const headers = new Headers({ Referer: 'https://carbonplan.org' })
const [relativeMedium, faux, mono] = await Promise.all([
fetch('https://fonts.carbonplan.org/relative/relative-medium-pro.woff', {
cache: 'force-cache',
Expand Down Expand Up @@ -64,8 +64,7 @@ const getFonts = async (origin) => {

export default async function handler(req) {
try {
const origin = new URL(req.url).origin
const fonts = await getFonts(origin)
const fonts = await getFonts()
const { searchParams } = new URL(req.url)
const id = searchParams.get('id')

Expand Down

0 comments on commit c28f784

Please sign in to comment.