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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Max Ludwig
January 02, 2016
Programming
510
0
Share
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
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
180
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
200
Vibe NLP for Applied NLP
inesmontani
PRO
0
120
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
120
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
140
How Swift's Type System Guides AI Agents
koher
0
190
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.7k
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
140
ファインチューニングせずメインコンペを解く方法
pokutuna
0
280
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
360
Coding as Prompting Since 2025
ragingwind
0
770
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
540
Featured
See All Featured
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
250
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Prompt Engineering for Job Search
mfonobong
0
260
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
150
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
760
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
880
Paper Plane
katiecoart
PRO
1
49k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
210
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]