Skip to content

Commit 55b3890

Browse files
committed
Resolve #1264
1 parent 53ea9e8 commit 55b3890

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,24 @@ Serving HTTP on 0.0.0.0 port 80 ...
11411141
NOTE
11421142
----
11431143

1144+
### Regular Expression Stack Overflow
1145+
1146+
> [!CAUTION]
1147+
> When using complex regex patterns in route handlers, be aware that certain patterns may cause stack overflow during pattern matching. This is a known issue with `std::regex` implementations and affects the `dispatch_request()` method.
1148+
>
1149+
> ```cpp
1150+
> // This pattern can cause stack overflow with large input
1151+
> svr.Get(".*", handler);
1152+
> ```
1153+
>
1154+
> Consider using simpler patterns or path parameters to avoid this issue:
1155+
>
1156+
> ```cpp
1157+
> // Safer alternatives
1158+
> svr.Get("/users/:id", handler); // Path parameters
1159+
> svr.Get(R"(/api/v\d+/.*)", handler); // More specific patterns
1160+
> ```
1161+
11441162
### g++
11451163
11461164
g++ 4.8 and below cannot build this library since `<regex>` in the versions are [broken](https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions).

0 commit comments

Comments
 (0)