fix: allow all internal urls

This commit is contained in:
Safwan Samsudeen 2025-08-25 11:00:55 +05:30
parent b426c3bedd
commit 6131aa63fd
3 changed files with 890 additions and 839 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@ import FileUploaderComponent from "./FileUploader.vue";
import { watch } from "vue";
class FileUploader {
static ExtraOptions = []
static UploadOptions = []
constructor({
wrapper,
method,
@ -66,7 +66,7 @@ class FileUploader {
allow_toggle_private,
allow_toggle_optimize,
allow_google_drive,
other_options: this.constructor.ExtraOptions.map((k) => ({
other_options: this.constructor.UploadOptions.map((k) => ({
...k,
wrappedAction: () =>
k.action({

View file

@ -417,7 +417,7 @@ def add_attachments(doctype, name, attachments):
def is_safe_path(path: str) -> bool:
if path.startswith(("http://", "https://", "/api/method/drive.api.files.get_file_content")):
if path.startswith(("http://", "https://", "/api/method/")):
return True
basedir = frappe.get_site_path()