瀏覽代碼

fix(monitor): Include request ip in monitored data

version-14
Aditya Hase 5 年之前
父節點
當前提交
268c577acd
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. +2
    -0
      frappe/monitor.py

+ 2
- 0
frappe/monitor.py 查看文件

@@ -42,6 +42,7 @@ class Monitor:
if self.transaction_type == "request": if self.transaction_type == "request":
self.data = frappe.form_dict self.data = frappe.form_dict
self.headers = dict(frappe.request.headers) self.headers = dict(frappe.request.headers)
self.ip = frappe.local.request_ip
self.method = frappe.request.method self.method = frappe.request.method
self.path = frappe.request.path self.path = frappe.request.path
else: else:
@@ -67,6 +68,7 @@ class Monitor:
update = { update = {
"data": self.data, "data": self.data,
"headers": self.headers, "headers": self.headers,
"ip": self.ip,
"method": self.method, "method": self.method,
"path": self.path, "path": self.path,
} }


Loading…
取消
儲存