Add X-Kubeshark-Capture: ignore header to all of the HTTP requests (#1579)

* Add `X-Kubeshark-Capture: ignore` header to all of the HTTP requests

* Add `X-Kubeshark-Capture: ignore` header to WebSocket requests

* Reduce duplication
This commit is contained in:
M. Mert Yildiran
2024-08-11 01:35:54 +03:00
committed by GitHub
parent 377ff44d71
commit ba126dff51
3 changed files with 20 additions and 1 deletions

View File

@@ -189,6 +189,7 @@ func (connector *Connector) PutScript(script *misc.Script, index int64) (err err
log.Error().Err(err).Send()
return
}
utils.AddIgnoreCaptureHeader(req)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("License-Key", config.Config.License)
@@ -228,6 +229,7 @@ func (connector *Connector) DeleteScript(index int64) (err error) {
log.Error().Err(err).Send()
return
}
utils.AddIgnoreCaptureHeader(req)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("License-Key", config.Config.License)