Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missed typed header value type #784

Open
maxdzin opened this issue Jun 20, 2024 · 0 comments
Open

Missed typed header value type #784

maxdzin opened this issue Jun 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@maxdzin
Copy link

maxdzin commented Jun 20, 2024

Environment

Nodejs v20.15.0

Reproduction

_

Describe the bug

Since the latest release of unjs/h3 v1.12.0, TypedHeaders 'retry-after' is missing string type:

"retry-after": number;

According to MDN docs, it can take as number (seconds) as well as a date string:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After

Additional context

In Nuxt app, I'm trying to set the response headers by this:

...
setResponseHeader(event, 'Retry-After', (maintenanceDateTo || dateNextDay).toUTCString())

Previously it worked fine since number or string values were valid. Now TS drops an error in a reason described above.

Logs

No response

@maxdzin maxdzin added the bug Something isn't working label Jun 20, 2024
@maxdzin maxdzin changed the title Missed header value type Missed typed header value type Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant