(request: NextRequest)
| 24 | * See: https://github.com/sourcebot-dev/sourcebot/pull/1076 |
| 25 | */ |
| 26 | export async function proxy(request: NextRequest) { |
| 27 | const url = request.nextUrl.clone(); |
| 28 | |
| 29 | if (url.pathname.startsWith('/~/')) { |
| 30 | url.pathname = url.pathname.replace(/^\/~/, ''); |
| 31 | return NextResponse.redirect(url, StatusCodes.MOVED_PERMANENTLY); |
| 32 | } |
| 33 | |
| 34 | if (url.pathname === '/~') { |
| 35 | url.pathname = '/'; |
| 36 | return NextResponse.redirect(url, StatusCodes.MOVED_PERMANENTLY); |
| 37 | } |
| 38 | |
| 39 | return NextResponse.next(); |
| 40 | } |
nothing calls this directly
no outgoing calls
no test coverage detected