File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class)
9494
9595 $ initialize = $ class ->getMethod ('initialize ' );
9696 $ config = $ this ->getConfig ();
97- $ headers = $ config ['headers ' ];
97+ $ headers = array_map ( ' strval ' , $ config ['headers ' ]) ;
9898
9999 if (isset ($ config ['frames ' ]) && $ config ['frames ' ] !== true && !isset ($ headers ['X-Frame-Options ' ])) {
100100 $ frames = $ config ['frames ' ];
@@ -128,7 +128,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class)
128128
129129 $ code [] = Helpers::formatArgs ('$response = $this->getService(?); ' , [$ this ->prefix ('response ' )]);
130130 foreach ($ headers as $ key => $ value ) {
131- if ($ value != null ) { // intentionally ==
131+ if ($ value !== '' ) {
132132 $ code [] = Helpers::formatArgs ('$response->setHeader(?, ?); ' , [$ key , $ value ]);
133133 }
134134 }
Original file line number Diff line number Diff line change 2626 headers:
2727 A: b
2828 C:
29+ D: 0
2930EOD
3031, 'neon ' ));
3132
@@ -39,6 +40,7 @@ Assert::contains('X-Frame-Options: SAMEORIGIN', $headers);
3940Assert::contains ('Content-Type: text/html; charset=utf-8 ' , $ headers );
4041Assert::contains ('X-Powered-By: Nette Framework 3 ' , $ headers );
4142Assert::contains ('A: b ' , $ headers );
43+ Assert::contains ('D: 0 ' , $ headers );
4244Assert::notContains ('C: ' , $ headers );
4345
4446
You can’t perform that action at this time.
0 commit comments