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

Make header value possibly undefined #927

Merged
merged 1 commit into from Oct 16, 2020
Merged

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented Oct 16, 2020

Previously this would cause a runtime crash if accessing a header that doesn't exist.

Fixes #924.

Since the index signature previously claimed that the value
was always `Buffer | string` it means that Typescript would
build even when accessing a header key that isn't guaranteed to
be there, and thus crash at runtime unless a null-check is in place.

Fixes #924.
@Nevon Nevon merged commit a79fc9e into master Oct 16, 2020
@Nevon Nevon deleted the update-header-type-definition branch October 16, 2020 07:49
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.

IHeaders type definition
2 participants