diff --git a/pyproject.toml b/pyproject.toml index 6e3e07f..4355a42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.0.43" +version = "2.0.48" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index beda9f7..92c21d0 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.0.43' +__version__ = '2.0.48' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 67cf0e2..a5925a6 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -201,7 +201,7 @@ def find_files(self, path: str) -> List[str]: for glob_file in glob_files: if os.path.isfile(glob_file) and not Core.is_excluded(glob_file, self.config.excluded_dirs): - files.add(glob_file) + files.add(glob_file.replace("\\", "/")) glob_end = time.time() log.debug(f"Globbing took {glob_end - glob_start:.4f} seconds") @@ -290,12 +290,10 @@ def load_files_for_sending(files: List[str], workspace: str) -> List[Tuple[str, [(field_name, (filename, file_object)), ...] """ send_files = [] - + if "\\" in workspace: + workspace = workspace.replace("\\", "/") for file_path in files: - if "/" in file_path: - _, name = file_path.rsplit("/", 1) - else: - name = file_path + _, name = file_path.rsplit("/", 1) if file_path.startswith(workspace): key = file_path[len(workspace):] @@ -306,7 +304,7 @@ def load_files_for_sending(files: List[str], workspace: str) -> List[Tuple[str, key = key.lstrip("./") f = open(file_path, 'rb') - payload = (key, (name, f)) + payload = (key, (name.lstrip(workspace), f)) send_files.append(payload) return send_files