(req: NextRequest)
| 153 | } |
| 154 | |
| 155 | export function getHost(req: NextRequest) { |
| 156 | // fallback is safe according to nextjs |
| 157 | // (github.com/vercel/next.js/issues/2469#issuecomment-313194091) |
| 158 | const protocol = req.headers.get("x-forwarded-proto") ?? "http"; |
| 159 | return protocol + "://" + req.headers.get("host"); |
| 160 | } |
| 161 | |
| 162 | export function getParam( |
| 163 | parameters: Record<string, any>, |