Skip to content

Commit ddd3d18

Browse files
committed
avoid duplicate requests to the cache proxy. fix #125
1 parent 1e0a515 commit ddd3d18

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ProxyClient/AbstractProxyClient.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ public function flush()
130130
*/
131131
protected function queueRequest($method, $url, array $headers = array())
132132
{
133-
$this->queue[] = $this->createRequest($method, $url, $headers);
133+
$signature = md5($method . "\n" . $url . "\n" . implode("\n", $headers));
134+
if (!isset($this->queue[$signature])) {
135+
$this->queue[$signature] = $this->createRequest($method, $url, $headers);
136+
}
134137
}
135138

136139
/**

0 commit comments

Comments
 (0)