Skip to content

Commit 045ee26

Browse files
romainneutronruflin
authored andcommitted
Optimize memory usage for Http Adapter (#1161)
1 parent 9ef242b commit 045ee26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Elastica/Transport/Http.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ public function exec(Request $request, array $params)
122122
}
123123

124124
if (is_array($data)) {
125-
$content = JSON::stringify($data, 'JSON_ELASTICSEARCH');
125+
$content = JSON::stringify($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
126126
} else {
127127
$content = $data;
128-
}
129128

130-
// Escaping of / not necessary. Causes problems in base64 encoding of files
131-
$content = str_replace('\/', '/', $content);
129+
// Escaping of / not necessary. Causes problems in base64 encoding of files
130+
$content = str_replace('\/', '/', $content);
131+
}
132132

133133
if ($connection->hasCompression()) {
134134
// Compress the body of the request ...

0 commit comments

Comments
 (0)