docs: ``Flask-Uploads``, ``X-Forwarded-Host``
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by defuz · committed by defuz · parent 06d9a5e · Browse files · 5 files·+9 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+9 added−9 removed
- other:+9 added−9 removed
Provenance
- Commit
17eee81- Tree
be95ba1- Author
defuz <defuz.net@gmail.com>- Committer
defuz <defuz.net@gmail.com>- Parent
06d9a5e
5 files changed+9 added−9 removed
modified:docs/deploying/wsgi-standalone.rst+2 added-2 removed
102 unmodified lines103 }104 }105 106 If your httpd is not providing these headers, the most common setup invokes the107-host being set from `X-Forwarded-Host` and the remote address from108-`X-Forwarded-For`::107+host being set from ``X-Forwarded-Host`` and the remote address from108+``X-Forwarded-For``::109 110 from werkzeug.contrib.fixers import ProxyFix111 app.wsgi_app = ProxyFix(app.wsgi_app)112 21 unmodified linesmodified:docs/patterns/appdispatch.rst+1 added-1 removed
142 unmodified lines143 Dispatch by Path144 ----------------145 146 Dispatching by a path on the URL is very similar. Instead of looking at147-the `Host` header to figure out the subdomain one simply looks at the147+the ``Host`` header to figure out the subdomain one simply looks at the148 request path up to the first slash::149 150 from threading import Lock151 from werkzeug.wsgi import pop_path_info, peek_path_info37 unmodified linesmodified:docs/patterns/fileuploads.rst+1 added-1 removed
182 unmodified lines183 ------------------184 185 Because the common pattern for file uploads exists almost unchanged in all186 applications dealing with uploads, there is a Flask extension called187-`Flask-Uploads`_ that implements a full fledged upload mechanism with187+``Flask-Uploads``_ that implements a full fledged upload mechanism with188 white and blacklisting of extensions and more.189 190 .. _Flask-Uploads: http://pythonhosted.org/Flask-Uploads/modified:flask/helpers.py+4 added-4 removed
416 unmodified lines417 """Sends the contents of a file to the client. This will use the418 most efficient method available and configured. By default it will419 try to use the WSGI server's file_wrapper support. Alternatively420 you can set the application's :attr:`~Flask.use_x_sendfile` attribute421- to ``True`` to directly emit an `X-Sendfile` header. This however422- requires support of the underlying webserver for `X-Sendfile`.421+ to ``True`` to directly emit an ``X-Sendfile`` header. This however422+ requires support of the underlying webserver for ``X-Sendfile``.423 424 By default it will try to guess the mimetype for you, but you can425 also explicitly provide one. For extra security you probably want426 to send certain files as attachment (HTML for instance). The mimetype25 unmodified lines452 :param filename_or_fp: the filename of the file to send. This is453 relative to the :attr:`~Flask.root_path` if a454 relative path is specified.455 Alternatively a file object might be provided456- in which case `X-Sendfile` might not work and456+ in which case ``X-Sendfile`` might not work and457 fall back to the traditional method. Make sure458 that the file pointer is positioned at the start459 of data to send before calling :func:`send_file`.460 :param mimetype: the mimetype of the file if provided, otherwise143 unmodified lines604 filename, as_attachment=True)605 606 .. admonition:: Sending files and Performance607 608- It is strongly recommended to activate either `X-Sendfile` support in608+ It is strongly recommended to activate either ``X-Sendfile`` support in609 your webserver or (if no authentication happens) to tell the webserver610 to serve files for the given path on its own without calling into the611 web application for improved performance.612 291 unmodified linesmodified:CHANGES+1 added-1 removed
378 unmodified lines379 380 Bugfix release, released on December 31st 2010381 382 - Fixed an issue where the default ``OPTIONS`` response was383- not exposing all valid methods in the `Allow` header.383+ not exposing all valid methods in the ``Allow`` header.384 - Jinja2 template loading syntax now allows "./" in front of385 a template load path. Previously this caused issues with386 module setups.387 - Fixed an issue where the subdomain setting for modules was151 unmodified lines