Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Fuentes <me@metcoder.dev>
  • Loading branch information
flakey5 and metcoder95 authored Dec 17, 2024
1 parent db84765 commit 01fc302
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/util/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ function parseHttpDate (date, now) {

date = date.toLowerCase()

if (date[3] === ',') {
return parseImfDate(date)
} else if (date[3] === ' ') {
return parseAscTimeDate(date)
} else {
return parseRfc850Date(date, now)
switch (date[3]) {
case ',': return parseImfDate(date)
case ' ': return parseAscTimeDate(date)
default: return parseRfc850Date(date, now)
}
}

Expand Down

0 comments on commit 01fc302

Please sign in to comment.