From b7d4121586e779bd40a1cfd2188b8180d4486ab5 Mon Sep 17 00:00:00 2001 From: Lagicrus Date: Wed, 11 Sep 2019 22:37:14 +0100 Subject: [PATCH] Update static_files.md (#1672) --- docs/sanic/static_files.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/sanic/static_files.md b/docs/sanic/static_files.md index d3075238..601f359c 100644 --- a/docs/sanic/static_files.md +++ b/docs/sanic/static_files.md @@ -34,6 +34,10 @@ app.url_for('static', name='another', filename='any') == '/another.png' bp = Blueprint('bp', url_prefix='/bp') bp.static('/static', './static') +# specify a different content_type for your files +# such as adding 'charset' +app.static('/', '/public/index.html', content_type="text/html; charset=utf-8") + # servers the file directly bp.static('/the_best.png', '/home/ubuntu/test.png', name='best_png') app.blueprint(bp)