5

I have done following things:

img_path = 'abc.jpg'
<img src="{{ img_path | imagine_filter(filter) }}">

So I want to have url with https. Currently I am getting url with http.

I have set router.request_context.scheme: https in parameters. But didn't work.

So actually I want to set vendor/symfony/symfony/src/Symfony/Component/Routing/RequestContext.php scheme property to https.

Jigar Pancholi
  • 1,209
  • 1
  • 8
  • 25

2 Answers2

1

I changed liip/imagine-bundle/Imagine/Cache/Resolver/WebPathResolver.php because I had the same problem.

In line 151 I put $this->requestContext->setScheme('https'); :

    $baseUrl = rtrim($baseUrl, '/\\');
    $this->requestContext->setScheme('https');
    return sprintf('%s://%s%s%s',
        $this->requestContext->getScheme(),
        $this->requestContext->getHost(),
        $port,
        $baseUrl
    );

But in my case, the old developer of the project completely changed this framwork and I will never be able to update it

-1

Sets the HTTP host to use for future requests. You must call this before issuing any HTTP requests. host is the name of the host, optionally with port (e.g. 'google.com' or 'localhost:5984') scheme the protocol scheme to use. Valid values are 'http', 'https'

Fady Saad
  • 1,169
  • 8
  • 13
  • Where to set HTTP host? I have tried to set this parameter ```router.request_context.scheme: https``` in parameter.yml file. But it didn't work. – Jigar Pancholi Mar 30 '17 at 09:35