dify/api/tests/unit_tests/core
Yongtao Huang 5bc6e8a433
Fix: correct regex for file-preview URL re-signing (#25620)
Fixes #25619

The regex patterns for file-preview and image-preview contained an unescaped `?`, 
which caused incorrect matches such as `file-previe` or `image-previw`. 
This led to malformed URLs being incorrectly re-signed.

Changes:
- Escape `?` in both file-preview and image-preview regex patterns.
- Ensure only valid URLs are re-signed.

Added unit tests to cover:
- Valid file-preview and image-preview URLs (correctly re-signed).
- Misspelled file/image preview URLs (no longer incorrectly matched).

Other:
- Fix a deprecated function `datetime.utcnow()`

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
2025-09-22 10:58:29 +08:00
..
agent/output_parser fix: code block syntax cannot be displayed correctly in react mode (#16904) 2025-03-31 16:27:29 +08:00
app feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
file feat: Persist Variables for Enhanced Debugging Workflow (#20699) 2025-06-24 09:05:29 +08:00
helper orm filter -> where (#22801) 2025-07-24 00:57:45 +08:00
mcp chore: adopt StrEnum and auto() for some string-typed enums (#25129) 2025-09-12 21:14:26 +08:00
model_runtime fix: correct agent node token counting to properly separate prompt and completion tokens (#24368) 2025-08-23 11:00:14 +08:00
ops feat: Enable Tracing Support For Phoenix Cloud Instance (#23196) 2025-07-30 15:58:26 -07:00
plugin refactor: unify blob chunk merging logic for plugin tool and agent (#24575) 2025-08-26 21:15:23 +08:00
prompt Feat/chat message image first for agent and advanced_chat APP (#23796) 2025-08-22 16:42:15 +08:00
rag test: remove print code (#25481) 2025-09-12 09:30:56 +08:00
repositories Fix: correct regex for file-preview URL re-signing (#25620) 2025-09-22 10:58:29 +08:00
schemas feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
tools feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
variables feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
workflow feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
test_file.py feat(llm_node): support order in text and files (#11837) 2024-12-20 14:12:50 +08:00
test_model_manager.py ext_redis.py support redis clusters --- Fixes #9538 (#9789) 2024-11-20 13:44:35 +08:00
test_provider_configuration.py feat: add multi model credentials (#24451) 2025-08-25 16:12:29 +08:00
test_provider_manager.py feat: add multi model credentials (#24451) 2025-08-25 16:12:29 +08:00