Open za-ek opened 7 years ago
public function getWebPath($value)
{
return 'http'.(($_SERVER['SERVER_PORT'] == 443 || isset($_SERVER['HTTPS']) || isset($_SERVER['HTTP_S'])) ? 's' : '' ).'://' . $_SERVER['SERVER_NAME']
. ($this->_app->conf()->get('request', 'port') ? ':' . $this->_app->conf()->get('request', 'port') : '')
. $value;
}
При добавлении css через метод CTemplate::addCss не учитывается порт. Например, у меня nginx настроен на 8080, апач на 80, при загрузке шрифтов выходит ошибка в браузере:
Access to Font at 'http://example.com/templates/current/fonts/fontawesome-webfont.ttf?v=4.7.0' from origin 'http://example.com:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com:8080' is therefore not allowed access.
Нужно сделать: