Skip to content

Commit efb6b7c

Browse files
committed
Do not enable compression if not supported
1 parent ee470be commit efb6b7c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Saver/UploadSaver.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function isSupported()
3232
public function save(array $data)
3333
{
3434
$json = json_encode($data);
35-
$this->submit($this->url, $json, $this->compress);
35+
$this->submit($this->url, $json, $this->hasCompression());
3636

3737
return true;
3838
}
@@ -84,4 +84,12 @@ private function submit($url, $payload, $compress)
8484
throw new ProfilerException($message);
8585
}
8686
}
87+
88+
/**
89+
* @return bool
90+
*/
91+
private function hasCompression()
92+
{
93+
return $this->compress && function_exists('gzencode');
94+
}
8795
}

0 commit comments

Comments
 (0)