Add dummy resp body

This commit is contained in:
Abhishek Pandey 2023-12-06 18:49:07 -08:00
parent d3b902b410
commit 93406f81a1

View File

@ -2,7 +2,9 @@ package graph
import (
"context"
"io"
"net/http"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
@ -290,6 +292,15 @@ func kiotaMiddlewares(
ChaosStrategy: khttp.Random,
ChaosPercentage: 50,
StatusCode: 429,
ResponseBody: &http.Response{
StatusCode: 429,
// Retry-After header
Header: http.Header{
"Retry-After": []string{"1"},
},
// Dummy body
Body: io.NopCloser(strings.NewReader("hello")),
},
}
chaosHandler, err := khttp.NewChaosHandlerWithOptions(chaosOpt)