Skip to content

Commit

Permalink
Merge pull request #114 from wjonkerhulst/master
Browse files Browse the repository at this point in the history
Set correct base URL protocol for Postman collection
  • Loading branch information
shalvah authored Oct 16, 2020
2 parents ff13564 + 057a5e3 commit a505b4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Writing/PostmanCollectionWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ protected function generateUrlObject($route)
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) {
Expand Down

0 comments on commit a505b4b

Please sign in to comment.