Skip to content

fix(malformed): Retry-After header parsing#1942

Merged
ryanio merged 1 commit intoProjectOpenSea:mainfrom
farquadars:fix-retry-after-header-parsing
Mar 18, 2026
Merged

fix(malformed): Retry-After header parsing#1942
ryanio merged 1 commit intoProjectOpenSea:mainfrom
farquadars:fix-retry-after-header-parsing

Conversation

@farquadars
Copy link
Contributor

Summary

Fix Retry-After parsing so malformed numeric-like values are no longer treated as valid retry delays.

What changed

  • only accept fully numeric integer Retry-After values
  • reject malformed values such as 5s and 1.5
  • add unit tests for these edge cases

This prevents incorrect retry delays when a proxy or upstream service returns an invalid Retry-After header.

@farquadars farquadars changed the title Fix malformed Retry-After header parsing fix(malformed): Retry-After header parsing Mar 18, 2026
Copy link
Collaborator

@ryanio ryanio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid fix — the current parseInt silently accepts malformed values like "5s". The tighter regex and Number.isSafeInteger check are the right approach. Tests look good too. LGTM!

@ryanio ryanio merged commit 3729d74 into ProjectOpenSea:main Mar 18, 2026
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants