-
Notifications
You must be signed in to change notification settings - Fork 589
/
translate_vars.go
31 lines (24 loc) · 1.04 KB
/
translate_vars.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package parser
import (
"regexp"
)
// -----------------------------------------------------------------------------
// Translation - Vars & Constants
// -----------------------------------------------------------------------------
const (
// DefaultServiceTimeout indicates the amount of time (by default) for
// connections, reads and writes to a service over a network should
// be given before timing out by default.
DefaultServiceTimeout = 60000
// DefaultRetries indicates the number of times a connection should be
// retried by default.
DefaultRetries = 5
// DefaultHTTPPort is the network port that should be assumed by default
// for HTTP traffic to services.
DefaultHTTPPort = 80
// kongHeaderRegexPrefix is a reserved prefix string that Kong uses to determine if it should parse a header value
// as a regex.
kongHeaderRegexPrefix = "~*"
)
// LegacyRegexPathExpression is the regular expression used by Kong <3.0 to determine if a path is not a regex.
var LegacyRegexPathExpression = regexp.MustCompile(`^[a-zA-Z0-9\.\-_~/%]*$`)