Fixed some small typos in the documentation.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sam Anderson · committed by Armin Ronacher · parent 5764f3a · Browse files · 5 files·+8 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
Diff stats
5 files+8 added−8 removed
- other:+8 added−8 removed
Provenance
- Commit
da00160- Tree
4f5d677- Author
Sam Anderson <coarse.sand@gmail.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
5764f3a
5 files changed+8 added−8 removed
modified:docs/config.rst+1 added-1 removed
206 unmodified lines207 208 class DevelopmentConfig(Config):209 DEBUG = True210 211- class TestinConfig(Config):211+ class TestingConfig(Config):212 TESTING = True213 214 To enable such a config you just have to call into215 :meth:`~flask.Config.from_object`::21 unmodified linesmodified:docs/errorhandling.rst+1 added-1 removed
103 unmodified lines104 `WARNING`)::105 106 if not app.debug:107 import logging108- from themodule import TheHandler YouWant108+ from themodule import TheHandlerYouWant109 file_handler = TheHandlerYouWant(...)110 file_handler.setLevel(logging.WARNING)111 app.logger.addHandler(file_handler)112 125 unmodified linesmodified:docs/extensiondev.rst+3 added-3 removed
286 unmodified lines287 extension to be approved you have to follow these guidelines:288 289 1. An approved Flask extension must provide exactly one package or module290 inside the `flaskext` namespace package.291-2. It must ship a testsuite that can either be invoked with ``make test``292- or ``python setup.py test``. For testsuites invoked with ``make291+2. It must ship a testing suite that can either be invoked with ``make test``292+ or ``python setup.py test``. For test suites invoked with ``make293 test`` the extension has to ensure that all dependencies for the test294 are installed automatically, in case of ``python setup.py test``295 dependencies for tests alone can be specified in the `setup.py`296- file. The testsuite also has to be part of the distribution.296+ file. The test suite also has to be part of the distribution.297 3. APIs of approved extensions will be checked for the following298 characteristics:299 300 - an approved extension has to support multiple applications27 unmodified linesmodified:docs/security.rst+2 added-2 removed
108 unmodified lines109 :func:`~flask.jsonify` so you are still at risk when using other ways to110 generate JSON.111 112 So what is the issue and how to avoid it? The problem are arrays at113-toplevel in JSON. Imagine you send the following data out in a JSON113+top-level in JSON. Imagine you send the following data out in a JSON114 request. Say that's exporting the names and email addresses of all your115 friends for a part of the user interface that is written in JavaScript.116 Not very uncommon:117 37 unmodified lines155 possible to patch constructors and register callbacks for setters. An156 attacker can use this (like above) to get all the data you exported in157 your JSON file. The browser will totally ignore the ``application/json``158 mimetype if ``text/javascript`` is defined as content type in the script159-tag and evaluate that as JavaScript. Because toplevel array elements are159+tag and evaluate that as JavaScript. Because top-level array elements are160 allowed (albeit useless) and we hooked in our own constructor, after that161 page loaded the data from the JSON response is in the `captured` array.162 163 Because it is a syntax error in JavaScript to have an object literal5 unmodified linesmodified:docs/styleguide.rst+1 added-1 removed
89 unmodified lines90 value=( item_value/item_count ) * offset/exp91 value = my_list[ index ]92 value = my_dict ['key']93 94-Yoda statements are a nogo:94+Yoda statements are a no-go:95 Never compare constant with variable, always variable with constant:96 97 Good::98 102 unmodified lines