File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,26 @@ func TestReadVSIX(t *testing.T) {
205
205
rw .Header ().Set ("Content-Length" , "1" )
206
206
},
207
207
},
208
+ {
209
+ name : "Redirect" ,
210
+ expected : testutil .Extensions [0 ],
211
+ handler : func (rw http.ResponseWriter , r * http.Request ) {
212
+ if r .URL .Path == "/redirected" {
213
+ vsix := testutil .CreateVSIXFromExtension (t , testutil .Extensions [0 ])
214
+ _ , err := rw .Write (vsix )
215
+ require .NoError (t , err )
216
+ } else {
217
+ http .Redirect (rw , r , "/redirected" , http .StatusFound )
218
+ }
219
+ },
220
+ },
221
+ {
222
+ name : "InfiniteRedirects" ,
223
+ error : "stopped after 10 redirects" ,
224
+ handler : func (rw http.ResponseWriter , r * http.Request ) {
225
+ http .Redirect (rw , r , "." , http .StatusFound )
226
+ },
227
+ },
208
228
}
209
229
210
230
for _ , test := range tests {
You can’t perform that action at this time.
0 commit comments