4

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.

4

2 回答 2

0

我更改了 liip/imagine-bundle/Imagine/Cache/Resolver/WebPathResolver.php 因为我遇到了同样的问题。

在第 151 行我把$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
    );

但就我而言,该项目的老开发人员完全改变了这个框架,我永远无法更新它

于 2017-04-20T14:28:23.820 回答
-1

设置用于未来请求的 HTTP 主机。您必须在发出任何 HTTP 请求之前调用它。host 是主机的名称,可以选择使用端口(例如“google.com”或“localhost:5984”)方案要使用的协议方案。有效值为“http”、“https”

于 2017-03-30T07:57:04.227 回答