nodeinfo: add MAIN_URL config usage

This commit is contained in:
Luna Mendes 2018-11-18 17:08:23 -03:00
parent c4a63016ea
commit d061ec6376
1 changed files with 3 additions and 1 deletions

View File

@ -6,9 +6,11 @@ bp = Blueprint('nodeinfo', __name__)
@bp.route('/.well-known/nodeinfo') @bp.route('/.well-known/nodeinfo')
async def _dummy_nodeinfo_index(): async def _dummy_nodeinfo_index():
proto = 'http' if not app.config['IS_SSL'] else 'https' proto = 'http' if not app.config['IS_SSL'] else 'https'
main_url = app.config.get('MAIN_URL', request.host)
return jsonify({ return jsonify({
'links': [{ 'links': [{
'href': f'{proto}://{request.host}/nodeinfo/2.0.json', 'href': f'{proto}://{main_url}/nodeinfo/2.0.json',
'rel': 'http://nodeinfo.diaspora.software/ns/schema/2.0' 'rel': 'http://nodeinfo.diaspora.software/ns/schema/2.0'
}] }]
}) })