Skip to content
Myr

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

5 files+8 added−8 removed

modified:docs/config.rst+1 added-1 removed
206 unmodified lines
207 208 class DevelopmentConfig(Config):209 DEBUG = True210211 class TestinConfig(Config):211 class TestingConfig(Config):212 TESTING = True213214To enable such a config you just have to call into215:meth:`~flask.Config.from_object`::
21 unmodified lines
modified:docs/errorhandling.rst+1 added-1 removed
103 unmodified lines
104`WARNING`)::105106 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 lines
modified:docs/extensiondev.rst+3 added-3 removed
286 unmodified lines
287extension to be approved you have to follow these guidelines:2882891. An approved Flask extension must provide exactly one package or module290 inside the `flaskext` namespace package.2912. It must ship a testsuite that can either be invoked with ``make test``292 or ``python setup.py test``. For testsuites invoked with ``make2912. 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.2973. APIs of approved extensions will be checked for the following298 characteristics:299300 - an approved extension has to support multiple applications
27 unmodified lines
modified:docs/security.rst+2 added-2 removed
108 unmodified lines
109:func:`~flask.jsonify` so you are still at risk when using other ways to110generate JSON.111112So what is the issue and how to avoid it? The problem are arrays at113toplevel in JSON. Imagine you send the following data out in a JSON113top-level in JSON. Imagine you send the following data out in a JSON114request. Say that's exporting the names and email addresses of all your115friends for a part of the user interface that is written in JavaScript.116Not very uncommon:117
37 unmodified lines
155possible to patch constructors and register callbacks for setters. An156attacker can use this (like above) to get all the data you exported in157your JSON file. The browser will totally ignore the ``application/json``158mimetype if ``text/javascript`` is defined as content type in the script159tag and evaluate that as JavaScript. Because toplevel array elements are159tag and evaluate that as JavaScript. Because top-level array elements are160allowed (albeit useless) and we hooked in our own constructor, after that161page loaded the data from the JSON response is in the `captured` array.162163Because it is a syntax error in JavaScript to have an object literal
5 unmodified lines
modified:docs/styleguide.rst+1 added-1 removed
89 unmodified lines
90 value=( item_value/item_count ) * offset/exp91 value = my_list[ index ]92 value = my_dict ['key']9394Yoda statements are a nogo:94Yoda statements are a no-go:95 Never compare constant with variable, always variable with constant:9697 Good::98
102 unmodified lines