(route: {
statusCode?: number
permanent?: boolean
})
| 3 | export const allowedStatusCodes = new Set([301, 302, 303, 307, 308]) |
| 4 | |
| 5 | export function getRedirectStatus(route: { |
| 6 | statusCode?: number |
| 7 | permanent?: boolean |
| 8 | }): number { |
| 9 | return ( |
| 10 | route.statusCode || |
| 11 | (route.permanent |
| 12 | ? RedirectStatusCode.PermanentRedirect |
| 13 | : RedirectStatusCode.TemporaryRedirect) |
| 14 | ) |
| 15 | } |
| 16 | |
| 17 | // for redirects we restrict matching /_next and for all routes |
| 18 | // we add an optional trailing slash at the end for easier |
no outgoing calls
no test coverage detected