3 Commits

Author SHA1 Message Date
codeflash-ai[bot]
a54f33e097
️ Speed up function validate_regex by 2,003%
### Explanation.

1. **Caching with lru_cache**.
   - By using `functools.lru_cache`, the function `validate_regex` now caches the results of previous calls. If the same pattern is validated multiple times, the cached result is returned immediately, significantly improving the performance for repeated patterns. This change optimizes the runtime without altering the function's behavior.
2025-02-09 14:04:43 +00:00
fabriziosalmi
f1bae07d6c feat: Generate Nginx WAF config with separate map and rule files
This commit modifies the script to output two files:
- waf_maps.conf (for http block)
- waf_rules.conf (for server block)
to avoid conflicts and provide more flexibility.

This update should fix the bugged nginx rules integration on existing setups: https://github.com/fabriziosalmi/patterns/issues/8
2025-01-28 22:41:54 +01:00
fabriziosalmi
1da19ed802 nginx generation improved 2025-01-16 13:49:54 +01:00