Skip to content

Commit a55adc2

Browse files
authored
The port should be specified in CURLOPT_PORT
Rather than including the port in the host, which also makes the host header include the port, the port should be assigned using the CURLOPT_PORT option.
1 parent 7241e69 commit a55adc2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Elasticsearch/Connections/Connection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@ public function __construct(
121121
$connectionParams['client']['curl'][CURLOPT_USERPWD] = $hostDetails['user'].':'.$hostDetails['pass'];
122122
}
123123

124+
$connectionParams['client']['curl'][CURLOPT_PORT] = $hostDetails['port'];
125+
124126
if (isset($connectionParams['client']['headers']) === true) {
125127
$this->headers = $connectionParams['client']['headers'];
126128
unset($connectionParams['client']['headers']);
127129
}
128130

129-
$host = $hostDetails['host'].':'.$hostDetails['port'];
131+
$host = $hostDetails['host'];
130132
$path = null;
131133
if (isset($hostDetails['path']) === true) {
132134
$path = $hostDetails['path'];

0 commit comments

Comments
 (0)