浏览代码

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

Nicholas Catanchin 5 年之前
父节点
当前提交
fa20e36111
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Postman/CollectionWriter.php

+ 4 - 0
src/Postman/CollectionWriter.php

@@ -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";