Skip to content

Commit c637e22

Browse files
committed
do not protect json by default
1 parent fbb8b28 commit c637e22

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ services:
101101
| `ipForwardedHeader` | `string` | `""` | Header to check for the original client IP if Traefik is behind a load balancer. |
102102
| `goodBots` | `[]string` (encouraged) | *see below* | List of second-level domains for bots that are never challenged or rate-limited. |
103103
| `protectParameters` | `string` | `"false"` | Forces rate limiting even for good bots if URL parameters are present. Useful for protecting faceted search pages. |
104-
| `protectFileExtensions` | `[]string` | `""` | Comma-separated file extentions to protect. By default, your protected routes only protect html and json files. This is to prevent files like CSS/JS/img from tripping the rate limit. |
104+
| `protectFileExtensions` | `[]string` | `""` | Comma-separated file extentions to protect. By default, your protected routes only protect html files. This is to prevent files like CSS/JS/img from tripping the rate limit. |
105105
| `exemptIps` | `[]string` | `privateIPs` | CIDR-formatted IPs that should never be challenged. Private IP ranges are always exempt. |
106106
| `challengeURL` | `string` | `"/challenge"` | URL where challenges are served. This will override existing routes if there is a conflict. |
107107
| `challengeTmpl` | `string` | `"./challenge.tmpl.html"`| Path to the Go HTML template for the captcha challenge page. |

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func CreateConfig() *Config {
7777
ProtectRoutes: []string{},
7878
ProtectFileExtensions: []string{
7979
"html",
80-
"json",
8180
},
8281
GoodBots: []string{},
8382
ExemptIPs: []string{

main_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,6 @@ func TestRouteIsProtected(t *testing.T) {
304304
path: "/foo/bar/style.css",
305305
expected: true,
306306
},
307-
{
308-
name: "json always protected",
309-
config: Config{
310-
ProtectRoutes: []string{"/"},
311-
ProtectFileExtensions: []string{"css", "js"},
312-
},
313-
path: "/foo/data.json",
314-
expected: true,
315-
},
316307
{
317308
name: "html always protected",
318309
config: Config{

0 commit comments

Comments
 (0)