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
Transcript
7 slides
… 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]
Other Decks in Programming
See All in Programming
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
340
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
350
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
140
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
350
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
Next.js: The final boss of Web Performance
guaca
0
410
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
130
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
320
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
190
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.3k
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
590
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
480
Writing Fast Ruby
sferik
630
63k
Design in an AI World
tapps
1
390
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Optimising Largest Contentful Paint
csswizardry
37
4k
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Discover your Explorer Soul
emna__ayadi
2
1.3k
WCS-LA-2024
lcolladotor
0
1k
Into the Great Unknown - MozCon
thekraken
41
2.8k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
The Curse of the Amulet
leimatthew05
4
17k