Kaynağa Gözat

proper passthru of non-matching requests

tags/v0.2.0
Jonathan Cobb 5 yıl önce
ebeveyn
işleme
9cb51928a1
1 değiştirilmiş dosya ile 15 ekleme ve 13 silme
  1. +15
    -13
      automation/roles/mitmproxy/files/bubble_modify.py

+ 15
- 13
automation/roles/mitmproxy/files/bubble_modify.py Dosyayı Görüntüle

@@ -63,20 +63,22 @@ def responseheaders(flow):
device = flow.request.headers[HEADER_BUBBLE_DEVICE]
if HEADER_CONTENT_TYPE in flow.response.headers:
content_type = flow.response.headers[HEADER_CONTENT_TYPE ]
if matchers:
# flow.response.stream = filter_with_matchers(matchers)
bubble_log("responseheaders: contentType="+repr(content_type)
+", req_id=" + req_id
+ ", device=" + device
+ ", matchers: " + repr(json.loads(matchers)))
flow.response.stream = bubble_modify(req_id,
content_type,
device,
matchers)
else:
bubble_log("responseheaders: no matchers, passing thru")
pass
else:
content_type = 'application/octet-stream'
bubble_log("responseheaders: "+HEADER_CONTENT_TYPE +" header not found in: "+repr(flow.response.headers))
if matchers:
# flow.response.stream = filter_with_matchers(matchers)
bubble_log("responseheaders: contentType="+repr(content_type)
+", req_id=" + req_id
+ ", device=" + device
+ ", matchers: " + repr(json.loads(matchers)))
flow.response.stream = bubble_modify(req_id,
content_type,
device,
matchers)
else:
bubble_log("responseheaders: no "+HEADER_CONTENT_TYPE +" header, passing thru")
pass
else:
bubble_log("responseheaders: no "+HEADER_BUBBLE_MATCHERS +" header, passing thru")
pass

Yükleniyor…
İptal
Kaydet