@@ -84,7 +84,7 @@ func runTestCases(t *testing.T, tests []TestCase) {
8484 if test .headers != nil {
8585 req .Header = test .headers
8686 }
87- req .URL .RawQuery = u .Query (). Encode ()
87+ req .URL .RawQuery = u .RawQuery
8888
8989 res , err := app .Test (req , fiber.TestConfig {Timeout : 0 , FailOnTimeout : false })
9090 assert .Nil (t , err )
@@ -185,6 +185,17 @@ func TestValidateEndpoint(t *testing.T) {
185185 assert .Empty (t , response ["results" ])
186186 },
187187 },
188+ {
189+ description : "validate: external checks explicitly disabled" ,
190+ query : "QUERY /v1/validate?external-checks=false" ,
191+ body : externalChecksYml ,
192+ expectedCode : 200 ,
193+ expectedContentType : "application/json; charset=utf-8" ,
194+ validateFunc : func (t * testing.T , response map [string ]any ) {
195+ assert .Equal (t , true , response ["valid" ])
196+ assert .Empty (t , response ["results" ])
197+ },
198+ },
188199 {
189200 description : "validate: external checks enabled" ,
190201 query : "QUERY /v1/validate?external-checks=true" ,
@@ -200,6 +211,29 @@ func TestValidateEndpoint(t *testing.T) {
200211 assert .Nil (t , response ["normalized" ])
201212 },
202213 },
214+ {
215+ description : "validate: repeated external checks use first value" ,
216+ query : "QUERY /v1/validate?external-checks=true&external-checks=false" ,
217+ body : externalChecksYml ,
218+ expectedCode : 200 ,
219+ expectedContentType : "application/json; charset=utf-8" ,
220+ validateFunc : func (t * testing.T , response map [string ]any ) {
221+ assert .Equal (t , false , response ["valid" ])
222+ results , ok := response ["results" ].([]any )
223+ assert .True (t , ok )
224+ assert .NotEmpty (t , results )
225+ assert .Contains (t , fmt .Sprint (results ), "non-public" )
226+ assert .Nil (t , response ["normalized" ])
227+ },
228+ },
229+ {
230+ description : "validate: malformed external checks flag" ,
231+ query : "QUERY /v1/validate?external-checks=invalid" ,
232+ body : validYml ,
233+ expectedCode : 400 ,
234+ expectedBody : `{"title":"invalid external-checks parameter","detail":"external-checks must be true or false","status":400}` ,
235+ expectedContentType : "application/problem+json" ,
236+ },
203237 {
204238 description : "validate: invalid file" ,
205239 query : "QUERY /v1/validate" ,
0 commit comments