Commit 2f10798
fix: use hex escape to block backslash open redirect in trailing-slash rewrite (#2361)
## Summary
- Previous fixes using backslash literals (`\\\\`, `\\`) in nginx regex
didn't work in production due to escaping differences across nginx
versions/environments
- Uses `\x5c` (PCRE hex escape for backslash byte) in a `map` directive
- completely unambiguous, no escaping issues possible
- The `map` sets `$uri_has_backslash` from `$uri` (nginx's decoded
form), and `if ($uri_has_backslash) { return 404; }` inside the
trailing-slash location prevents the redirect
Fixes apify/apify-core#26551
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d621120 commit 2f10798
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
37 | 48 | | |
38 | 49 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
0 commit comments