From e8cadd86f1fb1f8c268415c8c56064221469624a Mon Sep 17 00:00:00 2001 From: Ice3man543 Date: Fri, 10 Sep 2021 21:13:52 +0530 Subject: [PATCH] Misc --- v2/pkg/protocols/http/request.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/v2/pkg/protocols/http/request.go b/v2/pkg/protocols/http/request.go index 31672935..58486d42 100644 --- a/v2/pkg/protocols/http/request.go +++ b/v2/pkg/protocols/http/request.go @@ -434,10 +434,15 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, previ finalEvent := make(output.InternalEvent) // Decode gbk response content-types - if contentTypes, ok := resp.Header["Content-Type"]; ok && len(contentTypes) > 0 && strings.Contains(contentTypes[0], "gbk") && strings.Contains(contentTypes[0], "gb2312") { - dumpedResponse, err = decodegbk(dumpedResponse) - if err != nil { - return errors.Wrap(err, "could not store in project file") + if contentTypes, ok := resp.Header["Content-Type"]; ok && len(contentTypes) > 0 { + for _, value := range contentTypes { + if strings.Contains(value, "gbk") && strings.Contains(value, "gb2312") { + dumpedResponse, err = decodegbk(dumpedResponse) + if err != nil { + return errors.Wrap(err, "could not store in project file") + } + break + } } }