Skip to content
Myr

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

5 files+9 added−9 removed

modified:docs/deploying/wsgi-standalone.rst+2 added-2 removed
102 unmodified lines
103 }104 }105106If your httpd is not providing these headers, the most common setup invokes the107host being set from `X-Forwarded-Host` and the remote address from108`X-Forwarded-For`::107host being set from ``X-Forwarded-Host`` and the remote address from108``X-Forwarded-For``::109110 from werkzeug.contrib.fixers import ProxyFix111 app.wsgi_app = ProxyFix(app.wsgi_app)112
21 unmodified lines
modified:docs/patterns/appdispatch.rst+1 added-1 removed
142 unmodified lines
143Dispatch by Path144----------------145146Dispatching by a path on the URL is very similar. Instead of looking at147the `Host` header to figure out the subdomain one simply looks at the147the ``Host`` header to figure out the subdomain one simply looks at the148request path up to the first slash::149150 from threading import Lock151 from werkzeug.wsgi import pop_path_info, peek_path_info
37 unmodified lines
modified:docs/patterns/fileuploads.rst+1 added-1 removed
182 unmodified lines
183------------------184185Because the common pattern for file uploads exists almost unchanged in all186applications 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 with188white and blacklisting of extensions and more.189190.. _Flask-Uploads: http://pythonhosted.org/Flask-Uploads/
modified:flask/helpers.py+4 added-4 removed
416 unmodified lines
417 """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``.423424 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 mimetype
25 unmodified lines
452 :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, otherwise
143 unmodified lines
604 filename, as_attachment=True)605606 .. admonition:: Sending files and Performance607608 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 lines
modified:CHANGES+1 added-1 removed
378 unmodified lines
379380Bugfix release, released on December 31st 2010381382- 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 was
151 unmodified lines