Skip to content

fix : validate days parameter in repos route #500

@tmdeveloper007

Description

@tmdeveloper007

Summary of What Needs to be Done:
The repos route at src/app/api/metrics/repos/route.ts uses Number(req.nextUrl.searchParams.get(days)) || 30 which converts -5 to -5 instead of defaulting to 30. This allows negative or excessively large day values.

Changes that Need to be Made:

  • File: src/app/api/metrics/repos/route.ts (line 118)
  • Constrain days to valid range [1, 365] similar to contributions route

Impact that it would Provide:

  • Prevents invalid date range calculations
  • Ensures consistent API behavior

Metadata

Metadata

Assignees

Labels

gssoc:assignedGSSoC: Issue assigned to a contributor

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions