Warn on Protocol-relative URLs#7666
Merged
mikehardy merged 1 commit intoankidroid:masterfrom Nov 13, 2020
Merged
Conversation
We add a snackbar to warn the user and explain how to fix this. In Anki, protocol-relative URLS are converted to https:// In AnkIDroid, they're converted to file:// file:// fails to load the image - we can't redirect from shouldInterceptRequest Loading synchronously is not viable, so all we can do is use a snackbar. Fixes 6102
Arthur-Milchior
approved these changes
Nov 13, 2020
mikehardy
approved these changes
Nov 13, 2020
Member
mikehardy
left a comment
There was a problem hiding this comment.
LGTM - what do you think, 2.14-able? This looks like a bug fix to me and is an area well known to you. Might cause a quick follow-on but I can put this out as a beta today
Member
Author
|
@mikehardy It's a bugfix, hopefully non-functional, so 2.14 seems sensible |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Protocol relative URLs didn't work:
Fixes
Fixes #6102
Approach
We add a snackbar to warn the user and explain how to fix this.
In Anki, protocol-relative URLS are converted to https://
In AnkIDroid, they're converted to file://
file:// fails to load the image - we can't redirect from
shouldInterceptRequestLoading synchronously is not viable, so all we can do is use a snackbar.
How Has This Been Tested?
On my phone and API 19 emulator
Learning
shouldInterceptRequestChecklist
ifstatements)