diff --git a/lib/internal/validators.js b/lib/internal/validators.js index 50b3016ab78ec2..442e511ad58ed2 100644 --- a/lib/internal/validators.js +++ b/lib/internal/validators.js @@ -459,7 +459,7 @@ function validateUnion(value, name, union) { } } -const linkValueRegExp = /^(?:<[^>]*>;)\s*(?:rel=(")?[^;"]*\1;?)\s*(?:(?:as|anchor|title|crossorigin|disabled|fetchpriority|rel|referrerpolicy)=(")?[^;"]*\2)?$/; +const linkValueRegExp = /^(?:<[^>]*>)(?:\s*;\s*[^;"]+(?:=(")?[^;"]*\1)?)*$/; /** * @param {any} value @@ -473,7 +473,7 @@ function validateLinkHeaderFormat(value, name) { throw new ERR_INVALID_ARG_VALUE( name, value, - 'must be an array or string of format "; rel=preload; as=style"' + 'must be an array or string of format \'; rel=preload; as="style"\'' ); } }