Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript
376 B
Raw Blame
import { NextResponse } from 'next/server'

export function sameOriginRedirect(location: string, status = 303): NextResponse {
  if (!location.startsWith('/') || location.startsWith('//')) {
    throw new Error('sameOriginRedirect requires a relative same-origin path')
  }

  return new NextResponse(null, {
    status,
    headers: {
      Location: location,
    },
  })
}