fix: skip http validation for servers scripts in background tasks

This commit is contained in:
Shrihari Mahabal 2026-04-25 12:19:18 +05:30
parent 1cf89c9bc9
commit 234b0722a2

View file

@ -101,6 +101,10 @@ def is_valid_http_method(method):
if frappe.flags.in_safe_exec: if frappe.flags.in_safe_exec:
return return
# Skip HTTP method validation when running in a background job
if hasattr(frappe.local, "job"):
return
http_method = frappe.local.request.method http_method = frappe.local.request.method
if http_method not in frappe.allowed_http_methods_for_whitelisted_func[method]: if http_method not in frappe.allowed_http_methods_for_whitelisted_func[method]: