Encoded Characters
The Encoded Characters middleware controls which ambiguous reserved encoded characters are allowed in the request path.
When this middleware is attached to a router, potentially dangerous encoded characters are rejected by default for security enhancement. Each encoded character can be individually allowed via its dedicated option.
This middleware applies per-router, in addition to (and overriding for matched requests) the global encodedCharacters entry point options.
Configuration Examples
- Allow encoded slash
Allow encoded slash in the request path
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-encodedchars
namespace: apps
spec:
encodedCharacters:
allowEncodedSlash: true
Configuration Options
When configuring these options, ensure that your backend is fully compliant with RFC 3986. This avoids split-view situations where Traefik Hub API Gateway and your backend interpret the same URL differently.
| Field | Description | Default | Required |
|---|---|---|---|
allowEncodedSlash | Allow encoded slash (%2F and %2f) in the request path. | false | No |
allowEncodedBackSlash | Allow encoded backslash (%5C and %5c) in the request path. | false | No |
allowEncodedSemicolon | Allow encoded semicolon (%3B and %3b) in the request path. | false | No |
allowEncodedPercent | Allow encoded percent (%25) in the request path. | false | No |
allowEncodedQuestionMark | Allow encoded question mark (%3F and %3f) in the request path. | false | No |
allowEncodedHash | Allow encoded hash (%23) in the request path. | false | No |
