Add dummy resp body
This commit is contained in:
parent
d3b902b410
commit
93406f81a1
@ -2,7 +2,9 @@ package graph
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
@ -290,6 +292,15 @@ func kiotaMiddlewares(
|
|||||||
ChaosStrategy: khttp.Random,
|
ChaosStrategy: khttp.Random,
|
||||||
ChaosPercentage: 50,
|
ChaosPercentage: 50,
|
||||||
StatusCode: 429,
|
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)
|
chaosHandler, err := khttp.NewChaosHandlerWithOptions(chaosOpt)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user