Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 43b327b

Browse files
committed
Verbose exception message for header validators
1 parent 5587c48 commit 43b327b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HeaderSecurity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static function isValid($value)
129129
public static function assertValid($value)
130130
{
131131
if (! self::isValid($value)) {
132-
throw new InvalidArgumentException('Invalid header value');
132+
throw new InvalidArgumentException("'$value' is not valid header value");
133133
}
134134
}
135135

@@ -143,7 +143,7 @@ public static function assertValid($value)
143143
public static function assertValidName($name)
144144
{
145145
if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $name)) {
146-
throw new InvalidArgumentException('Invalid header name');
146+
throw new InvalidArgumentException("'$name' is not valid header name");
147147
}
148148
}
149149
}

0 commit comments

Comments
 (0)