diff --git a/files/captive-portal.py b/files/captive-portal.py index 536031d..d759d4d 100644 --- a/files/captive-portal.py +++ b/files/captive-portal.py @@ -1,6 +1,7 @@ import re +import json -from flask import Flask, abort, request, redirect +from flask import Flask, abort, request, redirect, Response import nftables from pyroute2 import IPDB @@ -72,7 +73,7 @@ def status(): result['venue-info-url'] = app.config['VENUE_INFO_URL'] result['seconds-remaining'] = mac_timeout // 1000 result['can-extend-session'] = True - return result + return Response(json.dumps(result), mimetype='application/captive+json') @app.route('/api/login', methods=['POST']) def login(): diff --git a/files/captive-portal.service b/files/captive-portal.service index 1bc8cc5..f99ed85 100644 --- a/files/captive-portal.service +++ b/files/captive-portal.service @@ -1,3 +1,4 @@ +[Install] After=network-online.target Wants=network-online.target