Skip to content
Myr

Merge pull request #2017 from rocambolesque/patch-1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add scheme to url_build error handler parameters

authored by David Lord · committed by GitHub · parents 7481844, e50767c · Browse files · 3 files+21 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+21 added−0 removed

  • tests:+17 added−0 removed
  • other:+4 added−0 removed

3 files+21 added−0 removed

modified:flask/helpers.py+1 added
329 unmodified lines
330 # deal with that sort of stuff.331 values['_external'] = external332 values['_anchor'] = anchor333 values['_method'] = method334 values['_scheme'] = scheme335 return appctx.app.handle_url_build_error(error, endpoint, values)336337 if anchor is not None:338 rv += '#' + url_quote(anchor)
640 unmodified lines
modified:tests/test_basic.py+17 added
1129 unmodified lines
1130 with app.test_request_context():1131 pytest.raises(BuildError, flask.url_for, 'not.existing')113211331134def test_url_for_passes_special_values_to_build_error_handler():1135 app = flask.Flask(__name__)11361137 @app.url_build_error_handlers.append1138 def handler(error, endpoint, values):1139 assert values == {1140 '_external': False,1141 '_anchor': None,1142 '_method': None,1143 '_scheme': None,1144 }1145 return 'handled'11461147 with app.test_request_context():1148 flask.url_for('/')114911501151def test_custom_converters():1152 from werkzeug.routing import BaseConverter11531154 class ListConverter(BaseConverter):
599 unmodified lines
modified:CHANGES+3 added
17 unmodified lines
18 and ``static_host``. This enables ``host_matching`` to be set properly by the19 time the constructor adds the static route, and enables the static route to20 be properly associated with the required host. (``#1559``)21- ``send_file`` supports Unicode in ``attachment_filename``. (`#2223`_)22- Pass ``_scheme`` argument from ``url_for`` to ``handle_build_error``.23 (`#2017`_)2425.. _#2017: https://github.com/pallets/flask/pull/201726.. _#2223: https://github.com/pallets/flask/pull/22232728Version 0.12.129--------------
609 unmodified lines