PageSourceSearch

https://tamada.lviv.ua/static/js/csrf.js

js tamada.lviv.ua collected 2026-10-02 19:04:14 UTC 894 bytes, 21 lines download raw bytes

1 $('html').ajaxSend(function(event, xhr, settings) {
2    function getCookie(name) {
3        var cookieValue = null;
4        if (document.cookie && document.cookie != '') {
5            var cookies = document.cookie.split(';');
6            for (var i = 0; i < cookies.length; i++) {
7                var cookie = jQuery.trim(cookies[i]);
8                // Does this cookie string begin with the name we want?
9                if (cookie.substring(0, name.length + 1) == (name + '=')) {
10                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
11                    break;
12                }
13            }
14        }
15        return cookieValue;
16    }
17    if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
18        // Only send the token to relative URLs i.e. locally.
19        xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
20    }
21});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.