This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ All notable changes to this project will be documented in this file, in reverse
2525 removes attributes with ` null ` values when calling ` withoutAttribute() ` .
2626- [ #132 ] ( https://github.com/zendframework/zend-diactoros/pull/132 ) updates the
2727 ` ServerRequestFactory ` to marshal the request path fragment, if present.
28+ - [ #142 ] ( https://github.com/zendframework/zend-diactoros/pull/142 ) updates the
29+ exceptions thrown by ` HeaderSecurity ` to include the header name and/or
30+ value.
2831
2932## 1.3.3 - 2016-01-04
3033
Original file line number Diff line number Diff line change @@ -130,7 +130,10 @@ 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 (sprintf (
134+ '"%s" is not valid header value ' ,
135+ $ value
136+ ));
134137 }
135138 }
136139
@@ -144,7 +147,10 @@ public static function assertValid($value)
144147 public static function assertValidName ($ name )
145148 {
146149 if (! preg_match ('/^[a-zA-Z0-9 \'`#$%&*+.^_|~!-]+$/ ' , $ name )) {
147- throw new InvalidArgumentException ('Invalid header name ' );
150+ throw new InvalidArgumentException (sprintf (
151+ '"%s" is not valid header name ' ,
152+ $ name
153+ ));
148154 }
149155 }
150156}
You can’t perform that action at this time.
0 commit comments