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

verifyDigestHeaderが不明なダイジェストアルゴリズムでエラーになる #7

Closed
Tracked by #4835
mei23 opened this issue Mar 4, 2024 · 1 comment · Fixed by #8
Closed
Tracked by #4835

Comments

@mei23
Copy link
Collaborator

mei23 commented Mar 4, 2024

verifyDigestHeaderが不明なダイジェストアルゴリズムでエラーになる

NotSupportedError: Unrecognized algorithm name
  at new DOMException (node:internal/per_context/domexception:53:5)
  at __node_internal_ (node:internal/util:670:10)
  at normalizeAlgorithm (node:internal/crypto/util:321:11)
  at normalizeAlgorithm (node:internal/crypto/util:293:12)
  at SubtleCrypto.digest (node:internal/crypto/webcrypto:79:15)
  at createBase64Digest (804:54)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async verifyRFC3230DigestHeader (844:16)
  at async verifyDigestHeader (859:12)

Expected: false

ここでサポートしているものをチェックするか

const algo = match[1] as DigestHashAlgorithm;
if (!algo) {
if (errorLogger) errorLogger(`Invalid Digest header algorithm: ${match[1]}`);
return false;
}

NotSupportedErrorをハンドルする。(ただ、サポートしていればなんでも通すのもどうか)

@mei23
Copy link
Collaborator Author

mei23 commented Mar 4, 2024

事前チェックはユーザー側制限 #4 に包括出来そうなので、とりあえずNotSupportedErrorだけハンドルするかしら

mei23 added a commit that referenced this issue Mar 4, 2024
@mei23 mei23 closed this as completed in #8 Mar 4, 2024
mei23 added a commit that referenced this issue Mar 4, 2024
* Handle Invalid Digest header algorithm Fix #7

* lint
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 a pull request may close this issue.

1 participant