Merge branch '0.10-maintenance'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parents 63d9ede, 58ad83f · Browse files · 3 files·+11 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+11 added−0 removed
- other:+11 added−0 removed
Provenance
- Commit
c9337c0- Tree
8ff7f8b- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
63d9ede- Parent 2
58ad83f
3 files changed+11 added−0 removed
modified:flask/testsuite/basic.py+3 added
324 unmodified lines325 def modify_session(response):326 flask.session['m'] = flask.Markup('Hello!')327 flask.session['u'] = the_uuid328 flask.session['dt'] = now329+ flask.session['b'] = b'\xff'330 flask.session['t'] = (1, 2, 3)331 return response332 333 @app.route('/')6 unmodified lines340 self.assert_equal(rv['m'], flask.Markup('Hello!'))341 self.assert_equal(type(rv['m']), flask.Markup)342 self.assert_equal(rv['dt'], now)343 self.assert_equal(rv['u'], the_uuid)344+ self.assert_equal(rv['b'], b'\xff')345+ self.assert_equal(type(rv['b']), bytes)346 self.assert_equal(rv['t'], (1, 2, 3))347 348 def test_flashes(self):349 app = flask.Flask(__name__)876 unmodified linesmodified:flask/sessions.py+5 added
9 unmodified lines10 """11 12 import uuid13 import hashlib14+from base64 import b64encode, b64decode15 from datetime import datetime16 from werkzeug.http import http_date, parse_date17 from werkzeug.datastructures import CallbackDict18 from . import Markup, json43 unmodified lines62 if isinstance(value, tuple):63 return {' t': [_tag(x) for x in value]}64 elif isinstance(value, uuid.UUID):65 return {' u': value.hex}66+ elif isinstance(value, bytes):67+ return {' b': b64encode(value).decode('ascii')}68 elif callable(getattr(value, '__html__', None)):69 return {' m': text_type(value.__html__())}70 elif isinstance(value, list):71 return [_tag(x) for x in value]20 unmodified lines92 if the_key == ' t':93 return tuple(the_value)94 elif the_key == ' u':95 return uuid.UUID(the_value)96+ elif the_key == ' b':97+ return b64decode(the_value)98 elif the_key == ' m':99 return Markup(the_value)100 elif the_key == ' d':101 return parse_date(the_value)231 unmodified linesmodified:CHANGES+3 added
10 unmodified lines11 - Fixed an issue where ``|tojson`` was not quoting single quotes which12 made the filter not work properly in HTML attributes. Now it's13 possible to use that filter in single quoted attributes. This should14 make using that filter with angular.js easier.15+- Added support for byte strings back to the session system. This broke16+ compatibility with the common case of people putting binary data for17+ token verification into the session.18 19 Version 0.1020 ------------21 442 unmodified lines