-
-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
android notif: Parse sender_avatar_url at crunchy shell.
Since at least server v1.6.0, we've never sent a `base_url` -- so the getter `getBaseURL` has never returned anything but `null`. So, first: hard-wire that to `null`, and constant-fold it through several layers where a `baseURL` value was passed. Doing so, we learn in `addHost` that if we'd ever had a `sender_avatar_url` which didn't start with `http`, we would have blown up with a NullPointerException on trying to use `baseURL` to fix it. This seems to be meant as a way of testing for a relative URL reference, vs. a real absolute URL (though it's an awfully buggy one.) So, pull that check up into the "crunchy shell" of parsing, and handle it appropriately. Also replace the check's logic with a non-buggy version: check that the URL parses as a real, absolute URL. A question this raises is: how likely was it that we'd get one of these crash-causing FCM messages (with `sender_avatar_url` not starting with `http`) in the wild? In the server Git history, it looks like server v1.6.0 could send `sender_avatar_url` as a relative URL if it's a local upload, or if there's no upload and ENABLE_GRAVATAR is false. But commit 1.7.0~3388, released Oct 2017, fixed that; since then it's always absolute.
- Loading branch information
Showing
3 changed files
with
13 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters