Browse Source

Merge pull request #114 from wjonkerhulst/master

Set correct base URL protocol for Postman collection
Shalvah 4 years ago
parent
commit
a505b4b221
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/Writing/PostmanCollectionWriter.php

+ 2 - 1
src/Writing/PostmanCollectionWriter.php

@@ -200,9 +200,10 @@ class PostmanCollectionWriter
             return Str::contains($route['uri'], '{' . $key . '}');
         });
 
+        $protocol = Str::startsWith($this->config->get('postman.base_url', $this->config->get('base_url')), 'https') ? 'https' : 'http';
         $baseUrl = $this->getBaseUrl($this->config->get('postman.base_url', $this->config->get('base_url')));
         $base = [
-            'protocol' => Str::startsWith($baseUrl, 'https') ? 'https' : 'http',
+            'protocol' => $protocol,
             'host' => $baseUrl,
             // Change laravel/symfony URL params ({example}) to Postman style, prefixed with a colon
             'path' => preg_replace_callback('/\{(\w+)\??}/', function ($matches) {