1 parent 5617e3d commit 21ae750Copy full SHA for 21ae750
1 file changed
apps/docs/app/api/search/route.ts
@@ -30,7 +30,7 @@ function getSearchLimit(value: unknown): number {
30
function getSearchParams(request: NextRequest) {
31
const searchParams = request.nextUrl.searchParams
32
return {
33
- query: searchParams.get('query') || searchParams.get('q') || '',
+ query: (searchParams.get('query') || searchParams.get('q') || '').slice(0, MAX_QUERY_LENGTH),
34
limit: getSearchLimit(searchParams.get('limit')),
35
}
36
@@ -40,7 +40,7 @@ export async function GET(request: NextRequest) {
40
try {
41
const { query, limit } = getSearchParams(request)
42
43
- if (query.trim().length === 0 || query.length > MAX_QUERY_LENGTH) {
+ if (query.trim().length === 0) {
44
return NextResponse.json([])
45
46
0 commit comments