File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ func main() {
7575
7676## Contributing
7777
78- If you'd like to contribute to the project, please read our [ Contributing guide] ( docs/ CONTRIBUTING.md) .
78+ If you'd like to contribute to the project, please read our [ Contributing guide] ( CONTRIBUTING.md ) .
7979
8080## License
8181
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ var mapBodies = map[string]mapParameterMasks{
3535 "types" : {
3636 defaultMasks : ngxConf1More ,
3737 },
38+ "split_clients" : {
39+ defaultMasks : ngxConfTake1 ,
40+ },
3841}
3942
4043// analyzeMapBody validates the body of a map-like directive. Map-like directives are block directives
Original file line number Diff line number Diff line change @@ -144,6 +144,27 @@ func TestAnalyzeMapBody(t *testing.T) {
144144 term : ";" ,
145145 wantErr : & ParseError {What : "invalid number of parameters" },
146146 },
147+ "valid split_clients" : {
148+ mapDirective : "split_clients" ,
149+ parameter : & Directive {
150+ Directive : "0.5%" ,
151+ Args : []string {"google.com" },
152+ Line : 5 ,
153+ Block : Directives {},
154+ },
155+ term : ";" ,
156+ },
157+ "invalid split_clients" : {
158+ mapDirective : "split_clients" ,
159+ parameter : & Directive {
160+ Directive : "0.5%" ,
161+ Args : []string {"google.com" , "testme" },
162+ Line : 5 ,
163+ Block : Directives {},
164+ },
165+ term : ";" ,
166+ wantErr : & ParseError {What : "invalid number of parameters" },
167+ },
147168 "missing semicolon" : {
148169 mapDirective : "map" ,
149170 parameter : & Directive {
You can’t perform that action at this time.
0 commit comments