Что это за предупреждение о межсайтовом приготовлении ie в моей консоли? - PullRequest
2 голосов
/ 10 июля 2020

Я использую python 3.7.4, django 3.06, javascript и jquery на windows 7.

Я не уверен, когда это произойдет, но теперь моя консоль (F12 на firefox) дает мне следующее предупреждение:

Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/js/common.js” because the scheme does not match. common.js
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/js/common.js” because the scheme does not match. common.js
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/lists/js/lists.js” because the scheme does not match. lists.js
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/lists/js/lists.js” because the scheme does not match. lists.js
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/jsi18n/” because the scheme does not match. jsi18n
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/jsi18n/” because the scheme does not match. jsi18n
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/icons/favicon.png” because the scheme does not match. favicon.png
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/icons/favicon.png” because the scheme does not match. favicon.png

Я тестировал свой код, я внес в него некоторые изменения, но ничего не связано с файлами cookie или администратором, и мой сайт имеет очень ограниченное использование для печенье. PGADMIN_KEY и PGADMIN_LANGUAGE выглядят как django куки-файлы администратора, и я их не трогал. jsi18n - это модуль перевода для django: это не мой код, я взял его как есть.

Я не делал обновлений в последнее время.

Не знаю какой код вам может понадобиться, чтобы помочь мне.

Я использую это в своем шаблоне (я вижу, что jquery.cookie больше не обновляется, но даже js.cookie.min.js дает ту же проблему):

<script type='text/javascript' src=' http://cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js '></script>
<script type='text/javascript' src="{% static '/js/common.js' %}"></script>
<link rel='icon' type='image/png' href="{% static 'icons/favicon.png' %}">

также это для файлов cookie:

var csrftoken = $.cookie('csrftoken');
function csrfSafeMethod(method) {
    // these HTTP methods do not require CSRF protection
    return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
$.ajaxSetup({
    beforeSend: function(xhr, settings) {
        if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
            xhr.setRequestHeader('X-CSRFToken', csrftoken);
        };
    }
});

Ответы [ 2 ]

2 голосов
/ 02 августа 2020

аналогичная ошибка, но без python и django, была решена очисткой файлов cookie (firefox | инструменты разработчика | Хранилище | файлы cookie ...) и обновлением страницы.

1 голос
/ 30 июля 2020

Предупреждения, как сказано в удаленном комментарии, должны исходить из новой политики в отношении файлов cookie . Файлы cookie поступают из pgAdmin, включенного в PostgreSQL.

Я решил обновить до последней версии pgAdmin И удалить файлы cookie, хранящиеся в кеше.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...