mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-14 10:53:30 +02:00
1669: Fix extract_host_port port separation r=mergify[bot] a=cbachert Regex quantifier should be lazy to make port separation work. ## What type of PR? bug-fix ## What does this PR do? The "extract_host_port" function in admin/mailu/internal/nginx.py and optional/fetchmail/fetchmail.py is not actually separating host and port due to the `(.*)` part of the regex being too generous. Lazy quantifier `(.*?)` allows the other capturing groups to match. ### Related issue(s) - No issue raised for this ## Prerequistes - [x] Documentation updated accordingly: N/A, bug-fix - [x] Add [changelog] entry file: Added towncrier newsfragment with second commit 1672: mark radio buttons in setup utility as required r=mergify[bot] a=lub ## What type of PR? bug-fix ## What does this PR do? mark radio buttons in setup utility as required Otherwise it's possible to submit the form without selecting e.g. any flavor, which would need additional handling on the server side. ### Related issue(s) ## Prerequistes Before we can consider review and merge, please make sure the following list is done and checked. If an entry in not applicable, you can check it or remove it from the list. - [ ] In case of feature or enhancement: documentation updated accordingly - [ ] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/guide.html#changelog) entry file. Co-authored-by: cbachert <cbachert@users.noreply.github.com> Co-authored-by: lub <git@lubiland.de>
This commit is contained in:
commit
d2ff6769cc
@ -84,7 +84,7 @@ def get_status(protocol, status):
|
||||
return status, codes[protocol]
|
||||
|
||||
def extract_host_port(host_and_port, default_port):
|
||||
host, _, port = re.match('^(.*)(:([0-9]*))?$', host_and_port).groups()
|
||||
host, _, port = re.match('^(.*?)(:([0-9]*))?$', host_and_port).groups()
|
||||
return host, int(port) if port else default_port
|
||||
|
||||
def get_server(protocol, authenticated=False):
|
||||
|
@ -28,7 +28,7 @@ poll "{host}" proto {protocol} port {port}
|
||||
|
||||
|
||||
def extract_host_port(host_and_port, default_port):
|
||||
host, _, port = re.match('^(.*)(:([0-9]*))?$', host_and_port).groups()
|
||||
host, _, port = re.match('^(.*?)(:([0-9]*))?$', host_and_port).groups()
|
||||
return host, int(port) if port else default_port
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
{% macro radio(name, value, emph, text, current) %}
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="{{ name }}" value="{{ value }}"{% if current == value %} checked="checked"{% endif %}>
|
||||
<input type="radio" name="{{ name }}" value="{{ value }}"{% if current == value %} checked="checked"{% endif %} required="required">
|
||||
{% if emph %}
|
||||
<strong>{{ emph }}</strong>,
|
||||
{% endif %}
|
||||
|
1
towncrier/newsfragments/1669.bugfix
Normal file
1
towncrier/newsfragments/1669.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix "extract_host_port" function to support containers with custom / dynamic ports
|
Loading…
Reference in New Issue
Block a user