File tree 1 file changed +16
-0
lines changed 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,22 @@ func TestRequestAndBatch(t *testing.T) {
354
354
` ))
355
355
assert .NoError (t , err )
356
356
})
357
+ t .Run ("custom compression" , func (t * testing.T ) {
358
+ // We should not try to decode it
359
+ tb .Mux .HandleFunc ("/customcompression" , http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
360
+ w .Header ().Set ("Content-Encoding" , "custom" )
361
+ _ , err := w .Write ([]byte (`{"custom": true}` ))
362
+ assert .NoError (t , err )
363
+ }))
364
+
365
+ _ , err := common .RunString (rt , sr (`
366
+ let res = http.get("HTTPBIN_URL/customcompression");
367
+ if (res.json()["custom"] != true) {
368
+ throw new Error("unexpected body data: " + res.body)
369
+ }
370
+ ` ))
371
+ assert .NoError (t , err )
372
+ })
357
373
})
358
374
t .Run ("CompressionWithAcceptEncodingHeader" , func (t * testing.T ) {
359
375
t .Run ("gzip" , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments