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
Max Ludwig
January 02, 2016
Programming
0
490
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
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
Team operations that are not burdened by SRE
kazatohiei
1
270
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
100
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
340
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
1
540
技術同人誌をMCP Serverにしてみた
74th
1
450
GraphRAGの仕組みまるわかり
tosuri13
8
500
Goで作る、開発・CI環境
sin392
0
170
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
170
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
1
590
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
710
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
160
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Unsuck your backbone
ammeep
671
58k
BBQ
matthewcrist
89
9.7k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Facilitating Awesome Meetings
lara
54
6.4k
Speed Design
sergeychernyshev
32
1k
A better future with KSS
kneath
239
17k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
940
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
680
Six Lessons from altMBA
skipperchong
28
3.9k
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]