Skip to content

Commit 86866ee

Browse files
DavidLanepulkitjalan
authored andcommitted
Making https optional (#29)
1 parent c180750 commit 86866ee

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Drivers/IpStackDriver.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ public function getRaw($ip)
7474
*/
7575
protected function getUrl($ip)
7676
{
77-
return 'https://api.ipstack.com/'.$ip.'?access_key='.array_get($this->config, 'key');
77+
$protocol = 'https';
78+
79+
if (!empty(array_get($this->config, 'http'))) {
80+
$protocol = 'http';
81+
}
82+
83+
return $protocol.'://api.ipstack.com/'.$ip.'?access_key='.array_get($this->config, 'key');
7884
}
7985
}

src/config/config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
|
3434
*/
3535
'key' => env('GEOIP_IPSTACK_KEY'),
36+
'http' => env('GEOIP_IPSTACK_HTTP', false),
3637
],
3738

3839
/*

0 commit comments

Comments
 (0)