Skip to content

500 error for GET /api/cve-id with date but no time #1328

@ElectricNroff

Description

@ElectricNroff

API call by any CNA:

GET /api/cve-id?time_reserved.gt=2025-01-01

Outcome:

HTTP/2 500

{"error":"SERVICE_NOT_AVAILABLE","message":"This service appears to not be available."}

This may be related to dateStr being out of scope on line 151:

if (value) {
const dateStr = value[0]
// Make sure that the string passed is a valid date
if (DateTime.fromISO(dateStr.toString()).isValid) {
result = new Date(dateStr)
}
} else {
value = val.match(/^\d{4}-\d{2}-\d{2}$/)
/* eslint-disable-next-line */
if ((value) && DateTime.fromISO(dateStr.toString()).isValid) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions