mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[PR #624] [MERGED] Fix issue with downloading attachments and PostgreSQL backend. #2763
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#2763
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/624
Author: @swedishborgie
Created: 9/16/2019
Status: ✅ Merged
Merged: 9/17/2019
Merged by: @dani-garcia
Base:
master← Head:postgresql📝 Commits (1)
1264eb6Added a migration that fixes #1 which caused attachments to be broken📊 Changes
2 files changed (+53 additions, -0 deletions)
View changed files
➕
migrations/postgresql/2019-09-16-150000_fix_attachments/down.sql(+26 -0)➕
migrations/postgresql/2019-09-16-150000_fix_attachments/up.sql(+27 -0)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.