-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify hashing for avatar #22289
Unify hashing for avatar #22289
Conversation
Gusted
commented
Dec 31, 2022
- Unify the hashing code for repository and user avatars into a function.
- Use a sane hash function instead of MD5.
- Only require hashing once instead of twice(w.r.t. hashing for user avatar).
- Improve the comment for the hashing code of why it works.
- Unify the hashing code for repo and user avatars into a function. - Use a sane hash function instead of MD5. - Only require hashing instead of twice(w.r.t. hashing for user avatar). - Improve the comment for the hashing code of why it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only change the URL where new avatars are stored with this PR, right?
So, existing avatars are unaffected?
Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
|
Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
--- FAIL: TestUploadAvatar (0.15s)
avatar_test.go:31:
Error Trace: /drone/src/services/repository/avatar_test.go:31
Error: Not equal:
expected: "10-9e24e19b024c44b778301d880bd8e6f4"
actual : "d5fcd714cb1265ec33652f2d41c48b7f42a8fc1d282b8c577b3e997d206ab4b6"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-10-9e24e19b024c44b778301d880bd8e6f4
+d5fcd714cb1265ec33652f2d41c48b7f42a8fc1d282b8c577b3e997d206ab4b6
Test: TestUploadAvatar
FAIL I guess that failure makes sense? |
Yup that's correct. |
* upstream/main: Add deprecated warning for DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR (go-gitea#22318) Unify hashing for avatar (go-gitea#22289) fix: code search title translation (go-gitea#22285) Update Gmail mailer configuration (go-gitea#22291) Fix due date rendering the wrong date in issue (go-gitea#22302) Fix get system setting bug when enabled redis cache (go-gitea#22295) Restructure `webhook` module (go-gitea#22256) Reminder for no more logs to console (go-gitea#22282) Fix bug of DisableGravatar default value (go-gitea#22296) Upgrade go-chi to v5.0.8 (go-gitea#22304) [skip ci] Updated licenses and gitignores Use ErrInvalidArgument in packages (go-gitea#22268) Changelog v1.18.0 (go-gitea#22215) (go-gitea#22269) Support estimated count with multiple schemas (go-gitea#22276) Add Gentoo to the from package providers (go-gitea#22284) Fix sitemap (go-gitea#22272) Add `sync_on_commit` option for push mirrors api (go-gitea#22271) Fix key signature error page (go-gitea#22229)