SwaggerLume
SwaggerLume copied to clipboard
swagger_lume_asset
How do I return https in the url of css and js.
I have already changed the APP_URL variable to HTTPS and it still does not work.
File: sagger-lume/index.blade.php
<link rel="stylesheet" type="text/css" href="{{ swagger_lume_asset('swagger-ui.css') }}" > <link rel="icon" type="image/png" href="{{ swagger_lume_asset('favicon-32x32.png') }}" sizes="32x32" /> <link rel="icon" type="image/png" href="{{ swagger_lume_asset('favicon-16x16.png') }}" sizes="16x16" />
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
@leonardyrj did you fix this issue, assets is not loading over https scheme?
@arnacmj I think the problem is not in swagger-lumen. It uses the standard route() function of the lumen/laravel. You can check your lumen settings and return some of your routes. For example
$router->get('/test_route', ['as' => 'test', function () { return route('test'); }]);
If you using proxy it may be useful to look here - https://laravel.com/docs/7.x/requests#configuring-trusted-proxies
ref https://cylab.be/blog/122/using-https-over-a-reverse-proxy-in-laravel
-
add this in your boot Provider (and configure .env app_url accordingly
if ($this->app->environment('production') && !empty(config('app.url'))) { $schema = explode(':', config('app.url'))[0]; URL::forceScheme($schema); }
-
you need to change swagger_lume_asset helper by removing last route parameter (app('request')->secure()