Skip to content

Conversation

txau
Copy link
Collaborator

@txau txau commented Oct 19, 2025

  • Introduced isFilePubliclyAccessible function to determine if files can be accessed publicly based on entity publication status and user authentication.
  • Added getCacheControlHeader function to set appropriate caching headers based on instance privacy and file accessibility.
  • Updated file download route to include Cache-Control and Last-Modified headers.
  • Expanded tests to cover new caching behavior and conditional requests for file downloads.

fixes #8524

txau added 6 commits October 19, 2025 09:53
- Introduced `isFilePubliclyAccessible` function to determine if files can be accessed publicly based on entity publication status and user authentication.
- Added `getCacheControlHeader` function to set appropriate caching headers based on instance privacy and file accessibility.
- Updated file download route to include Cache-Control and Last-Modified headers.
- Expanded tests to cover new caching behavior and conditional requests for file downloads.
- Simplified permission checks in `checkEntityPermission` and `isFilePubliclyAccessible` functions.
- Adjusted database queries to optimize data retrieval for related entities.
- Enhanced test setup for public and private instance scenarios in `downloadRoute.spec.ts` to ensure accurate user context handling.
- Cleaned up formatting in `MongoPermissionsDataSource` and `MongoV1ConnectionsDataSource` classes for better readability.
- Improved error handling in `isFilePubliclyAccessible` function to ensure safety when querying related entities.
- Updated tests in `downloadRoute.spec.ts` to reflect changes in file access logic and ensure proper handling of unpublished entities.
- Updated import statement in `commonTypes.d.ts` for cleaner syntax.
- Adjusted array syntax in `connectionType.d.ts` for consistency.
- Simplified nested type definition in `settingsType.d.ts` for improved readability.
…load route. Added error handling for missing creationDate and updated tests to cover edge cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant