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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Max Ludwig
January 02, 2016
Programming
520
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
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
180
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
280
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
1
380
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
500
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
270
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
410
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
120
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
530
高専キャリア LT 発表内容
crysta1221
6
5.4k
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
140
Deep dive into the select statement (GopherCon UK)
jespino
0
170
Featured
See All Featured
sira's awesome portfolio website redesign presentation
elsirapls
0
390
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
550
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
450
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
A Tale of Four Properties
chriscoyier
163
24k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
510
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
520
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
480
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
430
ラッコキーワード サービス紹介資料
rakko
1
4.7M
Embracing the Ebb and Flow
colly
88
5.2k
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]