TRA-3318 - Cookies not null and fix har file names (#69)

* no message
This commit is contained in:
gadotroee
2021-06-08 11:17:02 +03:00
committed by GitHub
parent fcf27e7c4d
commit 31dcfc4b2e
7 changed files with 54 additions and 53 deletions

View File

@@ -94,12 +94,13 @@ func GetHARs(c *fiber.Ctx) error {
_ = json.Unmarshal([]byte(entryData.Entry), &harEntry)
sourceOfEntry := entryData.ResolvedSource
if harOfSource, ok := harsObject[sourceOfEntry]; ok {
fileName := fmt.Sprintf("%s.har", sourceOfEntry)
if harOfSource, ok := harsObject[fileName]; ok {
harOfSource.Log.Entries = append(harOfSource.Log.Entries, &harEntry)
} else {
var entriesHar []*har.Entry
entriesHar = append(entriesHar, &harEntry)
harsObject[sourceOfEntry] = &models.ExtendedHAR{
harsObject[fileName] = &models.ExtendedHAR{
Log: &models.ExtendedLog{
Version: "1.2",
Creator: &models.ExtendedCreator{

View File

@@ -18,8 +18,8 @@ func FilterSensitiveInfoFromHarRequest(harOutputItem *tap.OutputChannelItem, opt
filterHarHeaders(harOutputItem.HarEntry.Request.Headers)
filterHarHeaders(harOutputItem.HarEntry.Response.Headers)
harOutputItem.HarEntry.Request.Cookies = nil
harOutputItem.HarEntry.Response.Cookies = nil
harOutputItem.HarEntry.Request.Cookies = make([]har.Cookie, 0, 0)
harOutputItem.HarEntry.Response.Cookies = make([]har.Cookie, 0, 0)
harOutputItem.HarEntry.Request.URL = filterUrl(harOutputItem.HarEntry.Request.URL)
for i, queryString := range harOutputItem.HarEntry.Request.QueryString {