Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
SwiftUIで本格音ゲー実装してみた
hypebeans
0
480
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
150
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.9k
AIコーディングエージェント(Gemini)
kondai24
0
260
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
430
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
460
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
530
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
150
Deno Tunnel を使ってみた話
kamekyame
0
220
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
270
JETLS.jl ─ A New Language Server for Julia
abap34
2
440
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
240
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
29
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
How to build a perfect <img>
jonoalderson
0
4.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
First, design no harm
axbom
PRO
1
1.1k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
340
Prompt Engineering for Job Search
mfonobong
0
120
Speed Design
sergeychernyshev
33
1.4k
Balancing Empowerment & Direction
lara
5
810
Raft: Consensus for Rubyists
vanstee
141
7.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]