feat: Add LICENSE file and refactor MITM response handling and tracing.
This commit is contained in:
@@ -64,16 +64,14 @@ pub(crate) fn upstream_err_response(
|
||||
let param = serde_json::from_str::<serde_json::Value>(&err.body)
|
||||
.ok()
|
||||
.and_then(|v| {
|
||||
v["error"]["details"]
|
||||
.as_array()
|
||||
.and_then(|details| {
|
||||
details.iter().find_map(|d| {
|
||||
d["fieldViolations"]
|
||||
.as_array()
|
||||
.and_then(|fv| fv.first())
|
||||
.and_then(|v| v["field"].as_str().map(|s| s.to_string()))
|
||||
})
|
||||
v["error"]["details"].as_array().and_then(|details| {
|
||||
details.iter().find_map(|d| {
|
||||
d["fieldViolations"]
|
||||
.as_array()
|
||||
.and_then(|fv| fv.first())
|
||||
.and_then(|v| v["field"].as_str().map(|s| s.to_string()))
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
let body = ErrorResponse {
|
||||
@@ -127,8 +125,6 @@ pub(crate) fn default_timeout() -> u64 {
|
||||
120
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub(crate) fn responses_sse_event(event_type: &str, data: serde_json::Value) -> Event {
|
||||
Event::default()
|
||||
.event(event_type)
|
||||
|
||||
Reference in New Issue
Block a user