|
Ran
|
Jobs
2
|
Files
82
|
Run time
46s
|
Badge
README BADGES
|
push
travis-ci
Fix whitelist/blacklist regex too broad (#1956) Fixes https://github.com/TykTechnologies/tyk/issues/1944 ``` apiLangIDsRegex := regexp.MustCompile(`{([^}]*)}`) asRegexStr := apiLangIDsRegex.ReplaceAllString(stringSpec, `([^/]*)`) ``` Basically removing logic of detection end of string. And at the same time modifying tests to do that: ``` v.Paths.WhiteList = []string{"/foo/{fooId}$", "/foo/{fooId}/bar/{barId}$"} ``` Basic idea here that here at Tyk we have backward compatibility policy, and this regexp was here for a few years, so there is chance that some of our customers relied on its "confusing" behavior. Thankfuly it was possible to fix it using "$" at the end of string, to explicitly set end of the string. In case of #1944 bug this trick was not working for urls containing {...}. Goal of this PR in this case can be making {...} groups support addign "$" to the end of URL. (cherry picked from commit f7c8f6992)
8936 of 14636 relevant lines covered (61.05%)
1.35 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 6005.1 (LATEST_GO=true) | 0 |
60.51 |
Travis Job 6005.1 | |
| 2 | 6005.2 (LATEST_GO=true) | 0 |
61.05 |
Travis Job 6005.2 |