mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-10 17:23:04 +03:00
[PR #624] Fix issue with downloading attachments and PostgreSQL backend. #3685
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/dani-garcia/vaultwarden/pull/624
State: closed
Merged: Yes
Apologies for the rapd-fire PR's. While testing today I realized that downloading attachments with the PostgreSQL backend is currently not working.
The root cause is that since attachments don't use UUID identifiers like the majority of other tables the usage of the
CHAR(36)type causes the identifiers to get padded out to 36 characters with spaces because of the odd way PostgreSQL handles the CHAR type. Since the request URL's get trimmed this causes attachments to be not retrievable.Since CHAR() in PostgreSQL is significantly different in behavior from MySQL and sqlite I added a migration that converts the
CHAR()types toVARCHAR(). This appears to fix the attachments issue and should prevent any future padding issues caused by PostgreSQL's handling of theCHAR()type.Please let me know if you'd like any changes.