diff --git a/src/NativeSender.php b/src/NativeSender.php index fe1f2d0..9d1c143 100644 --- a/src/NativeSender.php +++ b/src/NativeSender.php @@ -83,8 +83,8 @@ private function buildRequest(Request $smartyRequest) if ($smartyRequest->getReferer() != null) curl_setopt($ch, CURLOPT_REFERER, $smartyRequest->getReferer()); if ($this->ip != null) { - curl_setopt($ch, CURLOPT_HTTPHEADER, array("X_FORWARDED_FOR: $this->ip")); - $smartyRequest->setHeader('X_FORWARDED_FOR', $this->ip); + curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Forwarded-For: $this->ip")); + $smartyRequest->setHeader('X-Forwarded-For', $this->ip); } return $ch; diff --git a/tests/XForwardedForTest.php b/tests/XForwardedForTest.php index 8b4c0e4..39b6ced 100644 --- a/tests/XForwardedForTest.php +++ b/tests/XForwardedForTest.php @@ -23,7 +23,7 @@ public function testNativeSetOnQuery() { $sender->send($request); - $this->assertEquals("0.0.0.0", $request->getHeaders()["X_FORWARDED_FOR"]); + $this->assertEquals("0.0.0.0", $request->getHeaders()["X-Forwarded-For"]); } public function testNativeNotSet() { @@ -34,6 +34,6 @@ public function testNativeNotSet() { $sender->send($request); $headers = $request->getHeaders(); - $this->assertEquals(false, array_key_exists("X_FORWARDED_FOR", $headers)); + $this->assertEquals(false, array_key_exists("X-Forwarded-For", $headers)); } } \ No newline at end of file