Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Protecting static files in your web app
Search
Max Ludwig
January 02, 2016
Programming
530
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
sbt 2.0: takeoff
eed3si9n
0
160
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
JIS keyboard support in Omarchy
lef237
0
110
Next.js: The final boss of Web Performance
guaca
0
210
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
4
2.9k
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
130
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1k
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
360
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
Simple Storage Service(S3) is not simple
iwatsukayura
0
280
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
10k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Raft: Consensus for Rubyists
vanstee
142
7.8k
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Rails Girls Zürich Keynote
gr2m
96
14k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
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]