G
G
Greg Popov2016-06-24 17:42:16
Apache HTTP Server
Greg Popov, 2016-06-24 17:42:16

How to defeat error in the admin panel of Opencart?

There is a subdomain. It has a site on OpenCart.
sub.example.com - shop
sub.example.com/admin -
admin panel googled .htaccess

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
 
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]

Helps to get this error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK

Without it, the error is:
Запрос из постороннего источника заблокирован: Политика одного источника запрещает чтение удаленного ресурса на http://sub.example.com/admin/index.php?route=dashboard/chart/chart&token=twQohHe6yJAAI4CqH9rBJdxX42RYGCCo&range=month. (Причина: отсутствует заголовок CORS 'Access-Control-Allow-Origin').

How can I fight this infection???

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question