[FEATURE] Auto lowercase hosts
This commit is contained in:
parent
f277764cc0
commit
981c22a112
2 changed files with 9 additions and 1 deletions
|
@ -71,6 +71,9 @@ function payloadFilter(req, res) {
|
|||
return res
|
||||
.status(400)
|
||||
.send("Extra ports must be a list of strings with length of 5!");
|
||||
if (host !== host.toLowerCase())
|
||||
WARN("CREATE", "Host automatically being lowercasified...");
|
||||
req.body.host = host.toLowerCase();
|
||||
return "filtered";
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,16 @@ import TextField from "@mui/material/TextField";
|
|||
export default function HostOption(props) {
|
||||
const { value, onChange, disabled } = props;
|
||||
|
||||
function onTextChange(e) {
|
||||
e.target.value = e.target.value.toLowerCase();
|
||||
onChange(e);
|
||||
}
|
||||
|
||||
return (
|
||||
<TextField
|
||||
label="Host"
|
||||
value={value ?? ""}
|
||||
onChange={onChange}
|
||||
onChange={onTextChange}
|
||||
helperText="Example: host.mydomain.com"
|
||||
FormHelperTextProps={{ sx: { ml: 0 } }}
|
||||
required
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue