Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Protecting static files in your web app
Search
Max Ludwig
January 02, 2016
Programming
0
500
Protecting static files in your web app
... in production
https://github.com/dAnjou/xsendfile-example
Max Ludwig
January 02, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
490
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
900
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
200
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
250
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
0
850
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
180
Deno Tunnel を使ってみた話
kamekyame
0
340
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.6k
gunshi
kazupon
1
140
CSC307 Lecture 03
javiergs
PRO
1
480
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
370
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
680
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Fireside Chat
paigeccino
41
3.8k
For a Future-Friendly Web
brad_frost
181
10k
Six Lessons from altMBA
skipperchong
29
4.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Practical Orchestrator
shlominoach
191
11k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
72
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
150
エンジニアに許された特別な時間の終わり
watany
106
230k
The untapped power of vector embeddings
frankvandijk
1
1.5k
Technical Leadership for Architectural Decision Making
baasie
1
220
Transcript
… in production Protecting static files in your web app
X-Sendfile HTTP header
GET /video.ogv video.ogv web server web app check permissions +
set header check header + serve file
from django.http import HttpResponse from django.utils.encoding import smart_str def sendfile(request,
filename, **kwargs): # check requesting user’s permissions response = HttpResponse() response['X-Sendfile'] = smart_str(unicode(filename)) return response django-sendfile/sendfile/backends/xsendfile.py
<VirtualHost *:80> XSendFile On # ... </VirtualHost> /etc/apache2/sites-available/example.de
Apache2: X-Sendfile nginx: X-Accel-Redirect Lighttpd: X-LIGHTTPD-send-file
github.com/dAnjou/xsendfile-example
[email protected]