mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-22 10:37:23 +00:00
OAS: handle urlencoded and multipart form data correctly (#730)
* Start with tests * Expected file * Almost works * Make test stab;e * 5 examples, not 6 * Add param type * multipart example * parsing multipart * Commit * Commit * multipart * Write encoding into schema * Stable test * Add reset * Refactoring * Refactoring * Maintain the required flag * lint
This commit is contained in:
@@ -110,13 +110,14 @@ func feedFromHAR(file string, isSync bool) (int, error) {
|
||||
cnt := 0
|
||||
for _, entry := range harDoc.Log.Entries {
|
||||
cnt += 1
|
||||
feedEntry(&entry, "", isSync)
|
||||
feedEntry(&entry, "", isSync, file)
|
||||
}
|
||||
|
||||
return cnt, nil
|
||||
}
|
||||
|
||||
func feedEntry(entry *har.Entry, source string, isSync bool) {
|
||||
func feedEntry(entry *har.Entry, source string, isSync bool, file string) {
|
||||
entry.Comment = file
|
||||
if entry.Response.Status == 302 {
|
||||
logger.Log.Debugf("Dropped traffic entry due to permanent redirect status: %s", entry.StartedDateTime)
|
||||
}
|
||||
@@ -176,7 +177,7 @@ func feedFromLDJSON(file string, isSync bool) (int, error) {
|
||||
logger.Log.Warningf("Failed decoding entry: %s", line)
|
||||
} else {
|
||||
cnt += 1
|
||||
feedEntry(&entry, source, isSync)
|
||||
feedEntry(&entry, source, isSync, file)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user