Twitter-инструментарий на Ruby on Rails
Виджет amoCRM: экспорт данных в Google Docs
Alternative caching Joomla module
API Яндекс Метрика и Highcharts
JavaScript SELECT. Динамические списки
Extended weather informer. Weather Underground
Снова про курс валют Центробанка, про cross-origin и джаваскрипты
jTriad contact form - контактная форма для Joomla
jExchange rates CBR, модуль Joomla 3
Joomla: интернет-магазин без VirtueMart. K2Store
jWeather by ip. Погода по ip для Joomla!
CSV Improved. Настройка импорта из csv-файла в VirtueMart
Подарок бухгалтеру, или КЛАДР для Community Builder
Joomla и SuperJob: вакансии по API
Had this issue too several weeks ago and found this great solution.
It allows access to any sub-domain by dynamically looking at the HTTP_Origin header, extracting the sub-domain of the origin host, and using that in the Access-Control-Allow-Origin header.
Just add the following to your .htaccess file:
<IfModule mod_headers.c> <IfModule mod_rewrite.c> # Dynamically change the Access-Control-Allow-Origin header to match the sub-domain the request is coming from # Define the root domain that is allowed SetEnvIf Origin .+ ACCESS_CONTROL_ROOT=example.com # Check that the Origin: matches the defined root domain and capture it in an environment var if it does RewriteEngine On RewriteCond %{ENV:ACCESS_CONTROL_ROOT} !="" RewriteCond %{ENV:ACCESS_CONTROL_ORIGIN} ="" RewriteCond %{ENV:ACCESS_CONTROL_ROOT}&%{HTTP:Origin} ^([^&]+)&(https?://(?:.+?\.)?\1(?::\d{1,5})?)$ RewriteRule .* - [E=ACCESS_CONTROL_ORIGIN:%2] # Set the response header to the captured value if there was a match Header set Access-Control-Allow-Origin %{ACCESS_CONTROL_ORIGIN}e env=ACCESS_CONTROL_ORIGIN # Allow credentials to enable cookies being sent cross domain, so the user can stay logged is as long as the session file is available to both domains Header set Access-Control-Allow-Credentials "true" # Set here the headers needed for the AJAX requests, if a needed header is not in this list you will see an error in Chrome mentioning which header needs to be added here Header set Access-Control-Allow-Headers "sender, filename, content-type, accept, x-requested-with, x-request" </IfModule> </IfModule>
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Masterpro.ws © 2009 - 2020 Ruby and PHP Development. Web Studio