feat(transformer): Add split and retain strategy for dedupe (#2761)

This commit is contained in:
澄潭
2025-08-15 15:21:13 +08:00
committed by GitHub
parent a3310f1a3b
commit 995bcc2168
6 changed files with 98 additions and 5 deletions

View File

@@ -93,6 +93,7 @@ type Request struct {
Method string
Path string
Headers map[string]string
RawHeaders http.Header
Body []byte
ContentType string
UnfollowRedirect bool
@@ -240,6 +241,14 @@ func MakeRequestAndExpectEventuallyConsistentResponse(t *testing.T, r roundtripp
}
}
if expected.Request.ActualRequest.RawHeaders != nil {
for name, values := range expected.Request.ActualRequest.RawHeaders {
for _, value := range values {
req.Headers[name] = append(req.Headers[name], strings.TrimSpace(value))
}
}
}
backendSetHeaders := make([]string, 0, len(expected.Response.AdditionalResponseHeaders))
for name, val := range expected.Response.AdditionalResponseHeaders {
backendSetHeaders = append(backendSetHeaders, name+":"+val)
@@ -755,7 +764,7 @@ func (er *Assertion) GetTestCaseName(i int) string {
headerStr := ""
reqStr := ""
if er.Request.ActualRequest.Headers != nil {
if er.Request.ActualRequest.Headers != nil || er.Request.ActualRequest.RawHeaders != nil {
headerStr = " with headers"
}