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
510
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Protecting static files in your web app
... in production
https://github.com/dAnjou/xsendfile-example
Max Ludwig
January 02, 2016
Other Decks in Programming
See All in Programming
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
380
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
210
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
550
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
210
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
180
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.3k
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.7k
The NotImplementedError Problem in Ruby
koic
1
870
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
740
Unsuck your backbone
ammeep
672
58k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The SEO Collaboration Effect
kristinabergwall1
1
490
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Between Models and Reality
mayunak
4
340
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
430
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
240
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
Fireside Chat
paigeccino
42
4k
A better future with KSS
kneath
240
18k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
870
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]