Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/whitenoise/__pycache__/middleware.cpython-310.pyc

65 lines
6.1 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
ȯ<>f!<00>@s<>ddlmZddlZddlmZddlmZddlmZddl m
Z
ddl m Z ddl mZdd lmZdd
lmZdd lmZd gZGd d<0E>de<0E>ZGdd <0C>d e<12>ZdS)<10>)<01> annotationsN)<01>basename)<01>urlparse)<01>settings)<01>finders)<01>staticfiles_storage)<01> FileResponse)<01>get_script_prefix)<01>
WhiteNoise)<01>ensure_leading_trailing_slash<73>WhiteNoiseMiddlewarec@seZdZdZdd<03>ZdS)<05>WhiteNoiseFileResponsea 
Wrap Django's FileResponse to prevent setting any default headers. For the
most part these just duplicate work already done by WhiteNoise but in some
cases (e.g. the content-disposition header introduced in Django 3.0) they
are actively harmful.
cOsdS<00>N<>)<03>self<6C>args<67>kwargsrr<00>W/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/whitenoise/middleware.py<70> set_headerssz"WhiteNoiseFileResponse.set_headersN)<05>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rrrrrr s r csfeZdZdZdef<02>fdd<04> Zdd<06>Zedd<08><00>Zd d
<EFBFBD>Z <09>fd d <0C>Z
d d<0E>Z dd<10>Z dd<12>Z <0A>ZS)r zh
Wrap WhiteNoise to allow it to function as Django middleware, rather
than WSGI middleware.
Nc sP||_z|j}Wn ty|j}Ynwz|j}Wnty+|jr'd}nd}Ynwz|j}Wn ty<d}Ynwz|j}Wn tyMd}Ynwz|j}Wn ty^d}Ynwz|j}Wn tyod}Ynwz|j } Wn ty<>d} Ynwz|j
}
Wn ty<>d}
Ynwt <0B>j d||||||| |
d<05> z|j |_Wn ty<>|j|_Ynwz|j|_Wn*ty<>t|jp<>d<06>j|_t<14><00>d<07>} | r<>|j<10>| <0B>r<>|jt| <0B>d<00>|_Ynwt|j<10>|_|j|_|jr<>|j|j|jd<08>z|j} Wn t<02>y d} Ynw| <0C>r|<00>| <0C>|j<0E>r$|j<1D>s&|<00><1E>dSdSdS) Nr<00><Tzutf-8) <09> application<6F> autorefresh<73>max_age<67>allow_all_origins<6E>charset<65> mimetypes<65>add_headers_function<6F>
index_file<EFBFBD>immutable_file_test<73><00>/)<01>prefix)<1F> get_response<73>WHITENOISE_AUTOREFRESH<53>AttributeError<6F>DEBUG<55>WHITENOISE_MAX_AGE<47>WHITENOISE_ALLOW_ALL_ORIGINS<4E>WHITENOISE_CHARSET<45>WHITENOISE_MIMETYPES<45>WHITENOISE_ADD_HEADERS_FUNCTION<4F>WHITENOISE_INDEX_FILE<4C>WHITENOISE_IMMUTABLE_FILE_TEST<53>super<65>__init__<5F>WHITENOISE_USE_FINDERS<52> use_finders<72>WHITENOISE_STATIC_PREFIX<49> static_prefixr<00>
STATIC_URL<EFBFBD>pathr <00>rstrip<69>
startswith<EFBFBD>lenr <00> STATIC_ROOT<4F> static_root<6F> add_files<65>WHITENOISE_ROOTr<00>add_files_from_finders) rr&rrrrrrr r!r"<00> script_prefix<69>root<6F><01> __class__rrr2%s<>
 
<02>
 <04><02>
 <02>
 <02>
 <02>
 <02>
 <02>
 <02><06>   <02>    <04><02> 
<02>
 <08>zWhiteNoiseMiddleware.__init__cCs@|jr
|<00>|j<02>}n|j<03>|j<02>}|dur|<00>||<01>S|<00>|<01>Sr)r<00> find_file<6C> path_info<66>files<65>get<65>server&)r<00>request<73> static_filerrr<00>__call__us  
zWhiteNoiseMiddleware.__call__cCsN|<00>|j|j<02>}t|j<04>}t|jpd|d<02>}|d=|jD]\}}|||<q|S)Nr)<01>statusz content-type)r&<00>method<6F>META<54>intrMr <00>file<6C>headers)rKrJ<00>responserM<00> http_response<73>key<65>valuerrrrI~s

zWhiteNoiseMiddleware.servec Cs<>i}t<00><01>D]2}|<02>d<00>D]*\}}t|dd<00>pd<02>d<03>}d<02>|j||r%dnd|<03>dd<03>f<04>}|<01>||<04> |<03><01>q qdd<06>|<01>
<EFBFBD>D<00>}|<01> <0B>D] \}}|j |||d<07>qFdS)Nr%r#r$<00>\cSsi|]}|t<00>|<01><01>qSr)<02>os<6F>stat)<02>.0r8rrr<00>
<dictcomp><3E>sz?WhiteNoiseMiddleware.add_files_from_finders.<locals>.<dictcomp>)<01>
stat_cache) r<00> get_finders<72>list<73>getattr<74>strip<69>joinr6<00>replace<63>
setdefaultr8<00>values<65>items<6D>add_file_to_dictionary)rrG<00>finderr8<00>storager%<00>urlr\rrrr@<00>s" 

<02><04> <02> <04>z+WhiteNoiseMiddleware.add_files_from_findersc#sV<00>|jr|<01>|j<02>rt<03>|t|j<02>d<00><00>}|r|Vt<06><00>|<01>}|D]}|Vq#dSr)r4r:r6r<00>findr;r1<00>candidate_paths_for_url)rrir8<00>pathsrCrrrk<00>s<02> <04>z,WhiteNoiseMiddleware.candidate_paths_for_urlcCs^|<02>|j<01>sdS|t|j<01>d<02>}|<00>|<03>}||krdS|<00>|<04>}|r-t|<05>t|<02>kr-dSdS)z<>
Determine whether given URL represents an immutable file (i.e. a
file with a hash of its contents as part of its name) which can
therefore be cached forever
FNT)r:r6r;<00>get_name_without_hash<73>get_static_urlr)rr8ri<00>name<6D>name_without_hash<73>
static_urlrrrr"<00>s 

z(WhiteNoiseMiddleware.immutable_file_testcCs(tj<01>|<01>\}}tj<01>|<02>d}||S)aW
Removes the version hash from a filename e.g, transforms
'css/application.f3ea4bcc2.css' into 'css/application.css'
Note: this is specific to the naming scheme used by Django's
CachedStaticFilesStorage. You may have to override this if
you are using a different static files versioning system
r)rXr8<00>splitext)r<00>filename<6D>name_with_hash<73>extrorrrrm<00>s z*WhiteNoiseMiddleware.get_name_without_hashcCs"zt<00>|<01>WStyYdSwr)rri<00>
ValueError)rrorrrrn<00>s
  <02>z#WhiteNoiseMiddleware.get_static_url)rrrrrr2rL<00> staticmethodrIr@rkr"rmrn<00> __classcell__rrrCrr sP

  )<18>
__future__rrX<00> posixpathr<00> urllib.parser<00> django.confr<00>django.contrib.staticfilesr<00>"django.contrib.staticfiles.storager<00> django.httpr<00> django.urlsr <00>whitenoise.baser
<00>whitenoise.string_utilsr <00>__all__r r rrrr<00><module>s