Skip to content

Commit

Permalink
* Avoid blocking sockets of invalid HTTP connections (mainly happened…
Browse files Browse the repository at this point in the history
… when accessing the WebUI using smartphones)

* Added missing validators in WebUI
  • Loading branch information
alexreinert committed Jul 27, 2020
1 parent e07f926 commit c493f58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/webui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ WebUI::WebUI(Settings *settings, LED *statusLED, SysInfo *sysInfo, UpdateCheck *
void WebUI::start()
{
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.lru_purge_enable = true;
config.max_uri_handlers = 10;
config.uri_match_fn = httpd_uri_match_wildcard;

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
12 changes: 9 additions & 3 deletions webui/src/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,13 @@ import {
maxLength,
numeric,
ipAddress,
sameAs
sameAs,
helpers
} from "vuelidate/lib/validators";
const hostname = helpers.regex('hostname', /^[a-zA-Z0-9_-]{1,63}$/)
const domainname = helpers.regex('domainname', /^([a-zA-Z0-9_-]{1,63}\.)*[a-zA-Z0-9_-]{1,63}$/)
import VueI18n from "vue-i18n";
Vue.use(VueI18n);
Expand Down Expand Up @@ -273,6 +277,7 @@ export default {
},
hostname: {
required,
hostname,
maxLength: maxLength(32)
},
localIP: {
Expand All @@ -295,7 +300,8 @@ export default {
ipAddress
},
ntpServer: {
required: requiredIf("isNtpActived")
required: requiredIf("isNtpActived"),
domainname
},
dcfOffset: {
required: requiredIf("isDcfActived"),
Expand All @@ -322,7 +328,7 @@ export default {
this.$store
.dispatch("settings/save", {
adminPassword: self.adminPassword,
hostname: self.hostname + "2",
hostname: self.hostname,
useDHCP: self.useDHCP,
localIP: self.localIP,
netmask: self.netmask,
Expand Down

0 comments on commit c493f58

Please sign in to comment.