Resolves #543 For the HTTP scheme if baseUrl starts with https

This commit is contained in:
Nicholas Catanchin
2019-09-05 03:49:47 +10:00
parent b81cd1c01b
commit fa20e36111

View File

@@ -3,6 +3,7 @@
namespace Mpociot\ApiDoc\Postman;
use Ramsey\Uuid\Uuid;
use Illuminate\Support\Str;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\URL;
@@ -33,6 +34,9 @@ class CollectionWriter
{
try {
URL::forceRootUrl($this->baseUrl);
if (Str::startsWith($this->baseUrl, 'https://')) {
URL::forceScheme('https');
}
} catch (\Error $e) {
echo "Warning: Couldn't force base url as your version of Lumen doesn't have the forceRootUrl method.\n";
echo "You should probably double check URLs in your generated Postman collection.\n";