Skip to content

Commit 52ac433

Browse files
committed
fix: ValueError on CLI
[ValueError] The arguments array must contain 4 items, 1 given at SYSTEMPATH/HTTP/RequestTrait.php:121
1 parent 94c06b1 commit 52ac433

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

system/HTTP/RequestTrait.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ public function getIPAddress(): string
7373

7474
$this->ipAddress = $this->getServer('REMOTE_ADDR');
7575

76+
// If this is a CLI request, $this->ipAddress is null.
77+
if ($this->ipAddress === null) {
78+
return $this->ipAddress = '0.0.0.0';
79+
}
80+
7681
if ($proxyIPs) {
7782
// @TODO Extract all this IP address logic to another class.
7883
foreach ($proxyIPs as $proxyIP => $header) {

0 commit comments

Comments
 (0)