Skip to content

url_for('static', _external=True) gives bogus url with app.url_map.host_matching = True #1559

Closed
@jab

Description

@jab
app = Flask(__name__)
app.url_map.host_matching = True
app.url_map._rules_by_endpoint['static'][0].host = 'mydomain.com'  # XXX better way to do this?
with app.test_request_context():
    print url_for('static', filename='foo', _external=True)

=>
'http:///static/foo'

Expected 'http://mydomain.com/static/foo'.

Am I missing something, or is this a bug?

Thanks for looking and for the great work on Flask.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions