Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit f6fff3f

Browse files
authored
URL template match by extension (#751)
Changes to be committed: modified: src/WebHandlerImpl.h
1 parent 241aca3 commit f6fff3f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/WebHandlerImpl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ class AsyncCallbackWebHandler: public AsyncWebHandler {
105105
}
106106
} else
107107
#endif
108+
if (_uri.length() && _uri.startsWith("/*.")) {
109+
String uriTemplate = String (_uri);
110+
uriTemplate = uriTemplate.substring(uriTemplate.lastIndexOf("."));
111+
if (!request->url().endsWith(uriTemplate))
112+
return false;
113+
}
114+
else
108115
if (_uri.length() && _uri.endsWith("*")) {
109116
String uriTemplate = String(_uri);
110117
uriTemplate = uriTemplate.substring(0, uriTemplate.length() - 1);

0 commit comments

Comments
 (0)