You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the cache system to support external links and secure
cross-origin requests.
- Removed reliance on ROOT_LINK_OFFSET in cache functions.
- Implemented url_to_cache_path() to generate clean, unescaped cache
paths with ".." path sanitization for both local and external links.
- Updated Cache_create, Cache_open, and Cache_delete to use the new
url_to_cache_path helper for local filename mapping.
- Added is_same_origin helper in src/link.c to prevent credentials
and sensitive custom headers from being sent to cross-origin links.
- Resolved clang-tidy repeated branch body warning in Cache_create
by consolidating SONIC and SINGLE modes.
- Flattens external URL cache keys by replacing '/' and ':' with '_'
to prevent invalid nested directory creation/failures under
META_DIR and DATA_DIR.
- Adds defensive NULL check at the beginning of url_to_cache_path()
before any string operations.
- Adds comprehensive unit tests covering NULL input, local path
caching, and external URL path flattening/sanitization.
- Adds NULL guards for all url_to_cache_path() calls in cache.c.
- Fixes allocator mismatch for sonic.id in Cache_create() cleanup.
- Add check in Cache_delete for NULL link in NORMAL mode to return early
instead of falling back to raw path.
- Enable external links cache mode integration tests.
0 commit comments