Skip to content

Commit 329eca9

Browse files
committed
Remove URIMatchAll to avoid any mis-use form users
1 parent 7e9196b commit 329eca9

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/ESPAsyncWebServer.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ class AsyncWebServerRequest {
733733

734734
enum AsyncURIMatchFlags {
735735
// Meta flags - low bits
736-
URIMatchAll = 0, // No flags set
737736
URIMatchAuto = (1 << 0), // parse _uri at construct time and infer match type(s)
738737
// (_uri may be transformed to remove wildcards)
739738
URIMatchCaseInsensitive = (1 << 1),
@@ -743,7 +742,6 @@ enum AsyncURIMatchFlags {
743742
URIMatchPrefix = (1 << 30), // matches equivalent to regex: ^{_uri}.*
744743
URIMatchPrefixFolder = (1 << 29), // matches equivalent to regex: ^{_uri}/.*
745744
URIMatchExtension = (1 << 28), // non-regular match: /pattern../*.ext
746-
// TODO - suffix match?
747745

748746
#ifdef ASYNCWEBSERVER_REGEX
749747
URIMatchRegex = (1 << 27), // matches _url as regex
@@ -752,7 +750,7 @@ enum AsyncURIMatchFlags {
752750

753751
class AsyncURIMatcher {
754752
public:
755-
AsyncURIMatcher() : _flags(URIMatchAll) {}
753+
AsyncURIMatcher() {}
756754
AsyncURIMatcher(String uri, int flags = URIMatchAuto) : _value(std::move(uri)), _flags(flags) {
757755
#ifdef ASYNCWEBSERVER_REGEX
758756
if ((_flags & URIMatchRegex) || ((_flags & URIMatchAuto) && _value.startsWith("^") && _value.endsWith("$"))) {
@@ -764,12 +762,6 @@ class AsyncURIMatcher {
764762
_value.toLowerCase();
765763
}
766764
if (_flags & URIMatchAuto) {
767-
// Inspect _value to set flags
768-
// empty URI matches everything
769-
if (!_value.length()) {
770-
_flags = URIMatchAll;
771-
return;
772-
}
773765
// wildcard match with * at the end
774766
if (_value.endsWith("*")) {
775767
_flags |= URIMatchPrefix;
@@ -866,7 +858,7 @@ class AsyncURIMatcher {
866858
#endif
867859

868860
// empty URI matches everything
869-
if (_flags & URIMatchAll) {
861+
if (!_value.length()) {
870862
return true;
871863
}
872864

0 commit comments

Comments
 (0)