SimpleChatTCRV:SimpleProxy:DumpHeaders
This commit is contained in:
parent
67b9c68b3e
commit
efcd81aa2f
|
|
@ -51,7 +51,7 @@ def get_from_web(url: str, tag: str, inContentType: str, inHeaders: dict[str, st
|
||||||
statusMsg = response.msg or ""
|
statusMsg = response.msg or ""
|
||||||
contentType = response.getheader('Content-Type') or inContentType
|
contentType = response.getheader('Content-Type') or inContentType
|
||||||
print(f"DBUG:FM:GFW:Resp:{response.status}:{response.msg}")
|
print(f"DBUG:FM:GFW:Resp:{response.status}:{response.msg}")
|
||||||
debug.dump({ 'url': req.full_url, 'headers': req.headers, 'ctype': contentType }, { 'cdata': contentData })
|
debug.dump({ 'op': 'FileMagic.GetFromWeb', 'url': req.full_url, 'req.headers': req.headers, 'resp.headers': response.headers, 'ctype': contentType }, { 'cdata': contentData })
|
||||||
return Response(True, statusCode, statusMsg, contentType, contentData)
|
return Response(True, statusCode, statusMsg, contentType, contentData)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
return Response(False, 502, f"WARN:{tag}:Failed:{exc}")
|
return Response(False, 502, f"WARN:{tag}:Failed:{exc}")
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ def handle_htmltext(ph: 'ProxyHandler', pr: urllib.parse.ParseResult):
|
||||||
ph.send_header('Access-Control-Allow-Origin', '*')
|
ph.send_header('Access-Control-Allow-Origin', '*')
|
||||||
ph.end_headers()
|
ph.end_headers()
|
||||||
ph.wfile.write(textHtml.get_stripped_text().encode('utf-8'))
|
ph.wfile.write(textHtml.get_stripped_text().encode('utf-8'))
|
||||||
debug.dump({ 'RawText': 'yes', 'StrippedText': 'yes' }, { 'RawText': textHtml.text, 'StrippedText': textHtml.get_stripped_text() })
|
debug.dump({ 'op': 'WebMagic.HtmlText', 'RawText': 'yes', 'StrippedText': 'yes' }, { 'RawText': textHtml.text, 'StrippedText': textHtml.get_stripped_text() })
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
ph.send_error(502, f"WARN:HtmlText:Failed:{exc}")
|
ph.send_error(502, f"WARN:HtmlText:Failed:{exc}")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1092,7 +1092,7 @@ class MultiChatUI {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scroll the given element into view.
|
* Scroll the given element into view.
|
||||||
* @param {HTMLElement|null} el
|
* @param {Element|null} el
|
||||||
*/
|
*/
|
||||||
scroll_el_into_view(el) {
|
scroll_el_into_view(el) {
|
||||||
if (!el) {
|
if (!el) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue