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

Commit 2c80f45

Browse files
committed
Merge pull request #142 from mtymek/verbose_exception_messages
Verbose exception message from header validators
2 parents fe846d3 + 43b327b commit 2c80f45

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
@@ -130,7 +130,7 @@ public static function isValid($value)
130130
public static function assertValid($value)
131131
{
132132
if (! self::isValid($value)) {
133-
throw new InvalidArgumentException('Invalid header value');
133+
throw new InvalidArgumentException("'$value' is not valid header value");
134134
}
135135
}
136136

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

0 commit comments

Comments
 (0)