mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-01 22:00:31 +02:00
add correct version to remote headers, fix #131
This commit is contained in:
@@ -147,7 +147,12 @@ class CRemoteImage
|
|||||||
*/
|
*/
|
||||||
public function setHeaderFields()
|
public function setHeaderFields()
|
||||||
{
|
{
|
||||||
$this->http->setHeader("User-Agent", "CImage/0.7.2 (PHP/". phpversion() . " cURL)");
|
$cimageVersion = "CImage";
|
||||||
|
if (defined("CIMAGE_USER_AGENT")) {
|
||||||
|
$cimageVersion = CIMAGE_USER_AGENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->http->setHeader("User-Agent", "$cimageVersion (PHP/". phpversion() . " cURL)");
|
||||||
$this->http->setHeader("Accept", "image/jpeg,image/png,image/gif");
|
$this->http->setHeader("Accept", "image/jpeg,image/png,image/gif");
|
||||||
|
|
||||||
if ($this->useCache) {
|
if ($this->useCache) {
|
||||||
|
@@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
$version = "v0.7.8* (2015-12-06)";
|
$version = "v0.7.8* (2015-12-06)";
|
||||||
|
|
||||||
|
// For CRemoteImage
|
||||||
|
define(CIMAGE_USER_AGENT, "CImage/$version");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user