Skip to content

Commit 7987427

Browse files
committed
Fix responseCode null
1 parent 7920ba7 commit 7987427

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Ubiquity/utils/http/foundation/ReactHttp.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function getAllHeaders() {
2222

2323
public function header($key,$value,$replace=null,$http_response_code=null) {
2424
$this->headers[$key]=$value;
25-
if(isset($http_response_code)){
25+
if($http_response_code!=null){
2626
$this->responseCode=$http_response_code;
2727
}
2828
}
@@ -51,7 +51,9 @@ private function setHeaders($headers) {
5151
* @param int $responseCode
5252
*/
5353
public function setResponseCode($responseCode) {
54-
$this->responseCode = $responseCode;
54+
if($responseCode!=null){
55+
$this->responseCode = $responseCode;
56+
}
5557
}
5658

5759
public function headersSent(string &$file = null, int &$line = null) {

0 commit comments

Comments
 (0)