Skip to content

Commit 4b0db9d

Browse files
committed
API client user agent string should identify plugin version
1 parent 61df6aa commit 4b0db9d

File tree

1 file changed

+3
-2
lines changed
  • app/code/community/Mage42/PostcodeNL/Helper

1 file changed

+3
-2
lines changed

app/code/community/Mage42/PostcodeNL/Helper/Data.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
*/
66
class Mage42_PostcodeNL_Helper_Data extends Mage_Core_Helper_Abstract
77
{
8+
/** @var string This should be updated when tagging a new version of the plugin */
9+
const PLUGIN_VERSION = '1.0.1';
810
const SESSION_HEADER_KEY = 'X-Autocomplete-Session';
911
const API_TIMEOUT = 3;
1012
const ACCOUNT_URL = 'https://api.postcode.nl';
11-
const API_VERSION = 'v1';
1213

1314
protected $_curlHandler;
1415
protected $_mostRecentResponseHeaders = [];
@@ -39,7 +40,7 @@ public function __construct()
3940
curl_setopt($this->_curlHandler, CURLOPT_RETURNTRANSFER, true);
4041
curl_setopt($this->_curlHandler, CURLOPT_CONNECTTIMEOUT, self::API_TIMEOUT);
4142
curl_setopt($this->_curlHandler, CURLOPT_TIMEOUT, self::API_TIMEOUT);
42-
curl_setopt($this->_curlHandler, CURLOPT_USERAGENT, static::class . '/' . static::API_VERSION . ' PHP/' . PHP_VERSION);
43+
curl_setopt($this->_curlHandler, CURLOPT_USERAGENT, static::class . '/' . static::PLUGIN_VERSION . ' PHP/' . PHP_VERSION);
4344

4445
if (isset($_SERVER['HTTP_REFERER']))
4546
curl_setopt($this->_curlHandler, CURLOPT_REFERER, $_SERVER['HTTP_REFERER']);

0 commit comments

Comments
 (0)