fix: Set domain to lower in api requests
This commit is contained in:
parent
d19a121005
commit
c130bfed69
@ -206,6 +206,7 @@ def list_workers():
|
|||||||
@app.route('/site-info', methods=['GET'])
|
@app.route('/site-info', methods=['GET'])
|
||||||
def site_status():
|
def site_status():
|
||||||
domain = request.args.get('domain')
|
domain = request.args.get('domain')
|
||||||
|
domain = domain.lower()
|
||||||
if domain == None:
|
if domain == None:
|
||||||
return jsonify({'error': 'Invalid domain', 'success': 'false'})
|
return jsonify({'error': 'Invalid domain', 'success': 'false'})
|
||||||
|
|
||||||
@ -236,6 +237,7 @@ def site_status():
|
|||||||
@app.route('/info')
|
@app.route('/info')
|
||||||
def site_status_human():
|
def site_status_human():
|
||||||
domain = request.args.get('domain')
|
domain = request.args.get('domain')
|
||||||
|
domain = domain.lower()
|
||||||
if domain == None:
|
if domain == None:
|
||||||
return "<h1>Invalid domain</h1>"
|
return "<h1>Invalid domain</h1>"
|
||||||
|
|
||||||
@ -265,6 +267,7 @@ def site_status_human():
|
|||||||
@app.route('/tlsa', methods=['GET'])
|
@app.route('/tlsa', methods=['GET'])
|
||||||
def tlsa():
|
def tlsa():
|
||||||
domain = request.args.get('domain')
|
domain = request.args.get('domain')
|
||||||
|
domain = domain.lower()
|
||||||
if domain == None:
|
if domain == None:
|
||||||
return jsonify({'error': 'Invalid domain', 'success': 'false'})
|
return jsonify({'error': 'Invalid domain', 'success': 'false'})
|
||||||
|
|
||||||
@ -480,6 +483,9 @@ def register_post():
|
|||||||
if domain.startswith("http://") or domain.startswith("https://"):
|
if domain.startswith("http://") or domain.startswith("https://"):
|
||||||
return render_template('register.html', buy_licence_link=buy_licence_link, ERROR_MESSAGE="Domain should not contain http:// or https://")
|
return render_template('register.html', buy_licence_link=buy_licence_link, ERROR_MESSAGE="Domain should not contain http:// or https://")
|
||||||
|
|
||||||
|
# Set domain to lowercase
|
||||||
|
domain = domain.lower()
|
||||||
|
|
||||||
# Check if worker file exists
|
# Check if worker file exists
|
||||||
workers = None
|
workers = None
|
||||||
try:
|
try:
|
||||||
@ -529,6 +535,7 @@ def success():
|
|||||||
if 'domain' not in request.args:
|
if 'domain' not in request.args:
|
||||||
return redirect('/')
|
return redirect('/')
|
||||||
domain = request.args.get('domain')
|
domain = request.args.get('domain')
|
||||||
|
domain = domain.lower()
|
||||||
if not site_exists(domain):
|
if not site_exists(domain):
|
||||||
return render_template('success.html', message="Error: Domain does not exist\nPlease contact support")
|
return render_template('success.html', message="Error: Domain does not exist\nPlease contact support")
|
||||||
|
|
||||||
@ -711,7 +718,7 @@ def addsite():
|
|||||||
if domain.startswith("http://") or domain.startswith("https://"):
|
if domain.startswith("http://") or domain.startswith("https://"):
|
||||||
return jsonify({'error': 'Domain should not contain http:// or https://', 'success': 'false'})
|
return jsonify({'error': 'Domain should not contain http:// or https://', 'success': 'false'})
|
||||||
|
|
||||||
|
domain = domain.lower()
|
||||||
# Check if worker file exists
|
# Check if worker file exists
|
||||||
workers = None
|
workers = None
|
||||||
try:
|
try:
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<div class="mb-3"><input type="text" name="domain" placeholder="Domain"></div>
|
<div class="mb-3"><input type="text" name="domain" placeholder="Domain"></div>
|
||||||
<div class="mb-3"><input type="text" placeholder="Licence Key" name="licence"></div>
|
<div class="mb-3"><input type="text" placeholder="Licence Key" name="licence"></div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<p style="color: rgb(255,0,0);">{{ERROR_MESSAGE}}</p><button class="btn btn-primary shadow d-block w-100" type="submit">Sign up</button>
|
<p style="color: rgb(255,0,0);">{{ERROR_MESSAGE}}</p><button class="btn btn-primary shadow d-block w-100" type="submit">Create site</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-muted">Don't have a licence?<br><a href="{{buy_licence_link}}" target="_blank">Click here to buy one</a></p>
|
<p class="text-muted">Don't have a licence?<br><a href="{{buy_licence_link}}" target="_blank">Click here to buy one</a></p>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user