SwaggerLume icon indicating copy to clipboard operation
SwaggerLume copied to clipboard

swagger_lume_asset

Open leonardyrj opened this issue 5 years ago • 2 comments

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 avatar Jul 22 '19 12:07 leonardyrj

@leonardyrj did you fix this issue, assets is not loading over https scheme?

arnacmj avatar Mar 31 '20 22:03 arnacmj

@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

MatKonstantin avatar Jul 16 '20 14:07 MatKonstantin

ref https://cylab.be/blog/122/using-https-over-a-reverse-proxy-in-laravel

  1. 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);
     }
    
  2. you need to change swagger_lume_asset helper by removing last route parameter (app('request')->secure()

lolo3129 avatar Dec 08 '22 23:12 lolo3129