Skip to content

Commit ef788bc

Browse files
committed
Merge branch 'branch2.0'
2 parents 5872db2 + 3b6c804 commit ef788bc

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

tornado/auth.py

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def _on_auth(self, user):
4343
raise tornado.web.HTTPError(500, "Google auth failed")
4444
# Save the user with, e.g., set_secure_cookie()
4545
46+
.. note::
47+
48+
The ``tornado.auth`` module is not yet compatible with Python 3.
4649
"""
4750

4851
import base64

tornado/httpserver.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ def _on_request_body(self, data):
397397
class HTTPRequest(object):
398398
"""A single HTTP request.
399399
400+
All attributes are type `str` unless otherwise noted.
401+
400402
.. attribute:: method
401403
402404
HTTP request method, e.g. "GET" or "POST"
@@ -425,7 +427,7 @@ class HTTPRequest(object):
425427
426428
.. attribute:: body
427429
428-
Request body, if present.
430+
Request body, if present, as a byte string.
429431
430432
.. attribute:: remote_ip
431433
@@ -447,7 +449,10 @@ class HTTPRequest(object):
447449
448450
GET/POST arguments are available in the arguments property, which
449451
maps arguments names to lists of values (to support multiple values
450-
for individual names). Names and values are both unicode always.
452+
for individual names). Names are of type `str`, while arguments
453+
are byte strings. Note that this is different from
454+
`RequestHandler.get_argument`, which returns argument values as
455+
unicode strings.
451456
452457
.. attribute:: files
453458

website/sphinx/overview.rst

+8
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,14 @@ replacing ``{{ ... }}`` with ``{% raw ...%}``. Additionally, in each of
353353
these places the name of an alternative escaping function may be used
354354
instead of ``None``.
355355

356+
Note that while Tornado's automatic escaping is helpful in avoiding
357+
XSS vulnerabilities, it is not sufficient in all cases. Expressions
358+
that appear in certain locations, such as in Javascript or CSS, may need
359+
additional escaping. Additionally, either care must be taken to always
360+
use double quotes and ``xhtml_escape`` in HTML attributes that may contain
361+
untrusted content, or a separate escaping function must be used for
362+
attributes (see e.g. http://wonko.com/post/html-escaping)
363+
356364
Cookies and secure cookies
357365
~~~~~~~~~~~~~~~~~~~~~~~~~~
358366

website/sphinx/releases/v2.0.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Jun 21, 2011
1717
a previous release of Tornado must either disable autoescaping or adapt
1818
their templates to work with it. For most applications, the simplest
1919
way to do this is to pass autoescape=None to the Application constructor.
20+
Note that this affects certain built-in methods, e.g. xsrf_form_html
21+
and linkify, which must now be called with {% raw %} instead of {}
2022
* Applications that wish to continue using curl_httpclient instead of
2123
simple_httpclient may do so by calling
2224
AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")

website/templates/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h2>Installation</h2>
5555
<ul>
5656
<li>On Python 2.6 and 2.7, there are no dependencies outside the Python standard library, although <a href="http://pycurl.sourceforge.net/">PycURL</a> (version 7.18.2 or higher required; version 7.21.1 or higher recommended) may be used if desired.</li>
5757
<li>On Python 2.5, PycURL is required, along with <a href="http://pypi.python.org/pypi/simplejson/">simplejson</a> and the Python development headers (typically obtained by installing a package named something like <code>python-dev</code> from your operating system).</li>
58-
<li>On Python 3.2, the <a href="http://pypi.python.org/pypi/distribute">distribute</a> package is required.</li>
58+
<li>On Python 3.2, the <a href="http://pypi.python.org/pypi/distribute">distribute</a> package is required. Note that Python 3 support is new and may have bugs; in particular the <code>tornado.auth</code> module is known not to work on Python 3.</li>
5959
</ul></p>
6060

6161
<p><b>Platforms:</b> Tornado should run on any Unix-like platform, although

0 commit comments

Comments
 (0)