https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib64/python2.7/site-packages/django/middleware/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/middleware/csrf.pyc
�
r�\c@sdZddlmZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZejd
�ZdZdZd
ZdZdZd�Zd�Zd�Zd�Zd�Zdefd��YZdS(u�
Cross Site Request Forgery Middleware.

This module provides a middleware that implements protection
against request forgeries from other sites.
i����(tunicode_literalsN(tsettings(tget_callable(tpatch_vary_headers(t
force_text(tsame_origin(tconstant_time_comparetget_random_stringudjango.requestu%Referer checking failed - no Referer.u/Referer checking failed - %s does not match %s.uCSRF cookie not set.u CSRF token missing or incorrect.i cCs
ttj�S(u9
    Returns the view to be used for CSRF rejections
    (RRtCSRF_FAILURE_VIEW(((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyt_get_failure_viewscCs
tt�S(N(RtCSRF_KEY_LENGTH(((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyt_get_new_csrf_key$scCs t|jd<|jjdd�S(u�
    Returns the CSRF token required for a POST form. The token is an
    alphanumeric value.

    A side effect of calling this function is to make the csrf_protect
    decorator and the CsrfViewMiddleware add a CSRF cookie and a 'Vary: Cookie'
    header to the outgoing response.  For this reason, you may need to use this
    function lazily, as is done by the csrf context processor.
    uCSRF_COOKIE_USEDuCSRF_COOKIEN(tTruetMETAtgettNone(trequest((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyt	get_token(s

cCs%|jjitd6t�d6�dS(uj
    Changes the CSRF token in use for a request - should be done on login
    for security purposes.
    uCSRF_COOKIE_USEDuCSRF_COOKIEN(R
tupdateRR(R((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pytrotate_token6scCsKt|�tkrt�Stjddt|��}|dkrGt�S|S(Nu
[^a-zA-Z0-9]+u(tlenR
RtretsubR(ttoken((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyt_sanitize_tokenAstCsrfViewMiddlewarecBs2eZdZd�Zd�Zd�Zd�ZRS(u�
    Middleware that requires a present and correct csrfmiddlewaretoken
    for POST requests that have a CSRF cookie, and sets an outgoing
    CSRF cookie.

    This middleware should be used in conjunction with the csrf_token template
    tag.
    cCs
t|_dS(N(Rtcsrf_processing_doneR(tselfR((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyt_acceptWs	cCs=tjd||jdidd6|d6�t�|d|�S(NuForbidden (%s): %stextrai�ustatus_codeurequesttreason(tloggertwarningtpathR	(RRR((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyt_reject^s	c
Cs�t|dt�rdSy't|jtj�}||jd<Wn'tk
rfd}t	�|jd<nXt|dt�r}dS|j
dkr�t|dt�r�|j|�S|j�r'|jj
d	�}|dkr�|j|t�Sd
|j�}t||�s't||f}|j||�Sn|dkrC|j|t�Sd}	|j
dkrp|jj
d
d�}	n|	dkr�|jj
dd�}	nt|	|�s�|j|t�Sn|j|�S(Nucsrf_processing_doneuCSRF_COOKIEucsrf_exemptuGETuHEADuOPTIONSuTRACEu_dont_enforce_csrf_checksuHTTP_REFERERuhttps://%s/uuPOSTucsrfmiddlewaretokenuHTTP_X_CSRFTOKEN(uGETuHEADuOPTIONSuTRACE(tgetattrtFalseRRtCOOKIESRtCSRF_COOKIE_NAMER
tKeyErrorRtmethodRt	is_secureRR"tREASON_NO_REFERERtget_hostRtREASON_BAD_REFERERtREASON_NO_CSRF_COOKIEtPOSTRtREASON_BAD_TOKEN(
RRtcallbackt
callback_argstcallback_kwargst
csrf_tokentreferertgood_refererRtrequest_csrf_token((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pytprocess_viewhs@

c
Cs�t|dt�r|S|jjd�dkr2|S|jjdt�sK|S|jtj|jdddd	tjd
tj	dtj
dtj�t|d�t
|_|S(Nucsrf_processing_doneuCSRF_COOKIEuCSRF_COOKIE_USEDtmax_agei<iii4tdomainR!tsecurethttponlyuCookieii�Qi�:	i��(uCookie(R#R$R
RRt
set_cookieRR&tCSRF_COOKIE_DOMAINtCSRF_COOKIE_PATHtCSRF_COOKIE_SECUREtCSRF_COOKIE_HTTPONLYRRR(RRtresponse((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pytprocess_response�s 
			

	(t__name__t
__module__t__doc__RR"R7RB(((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyRLs
		
	N( REt
__future__RtloggingRtdjango.confRtdjango.core.urlresolversRtdjango.utils.cacheRtdjango.utils.encodingRtdjango.utils.httpRtdjango.utils.cryptoRRt	getLoggerRR*R,R-R/R
R	RRRRtobjectR(((s8/tmp/pip-install-XxeQeY/django/django/middleware/csrf.pyt<module>s*					

https://t.me/AnonymousX5 - 2025