Skip to content

Add check for undefined headerValue #8

Description

@mattcollier

The value of headerValue is not tested before it is passed into _parseHeaderValue here:

https://github.com/digitalbazaar/http-digest-header/blob/master/lib/httpDigest.js#L41

Therefore, it is possible that an unexpected error can occur when calling .split on undefined here:

function _parseHeaderValue(headerValue) {
const [key, encodedDigest] = headerValue.split(/=(.+)/);

There should be a check to ensure that headerValue is a string and if not, an appropriate TypeError should be thrown.

Related: https://github.com/digitalbazaar/bedrock-edv-storage/pull/70/files#r555269144

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions