-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix: UserAgent is wrong on google.* if not .com #654
Conversation
🤖 Pull request artifacts
|
454e361
to
44ecdc8
Compare
@@ -118,6 +118,7 @@ public class IITC_Mobile extends AppCompatActivity | |||
private String debugInputStore = ""; | |||
private Map<String, String> mAllowedHostnames = new HashMap<>(); | |||
private Set<String> mInternalHostnames = new HashSet<>(); | |||
private final Pattern mGoogleHostnamePattern = Pattern.compile("google\\.(com\\.|co\\.).\\w+$"); |
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.
private final Pattern mGoogleHostnamePattern = Pattern.compile("google\\.(com\\.|co\\.).\\w+$"); | |
private final Pattern mGoogleHostnamePattern = Pattern.compile("google\\.(com\\.|co\\.)?\\w+$"); |
If the match should work as mentioned in comment (for google.com?.*), The pattern should look like this, right? 🤔
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.
fixup half fixed this, (?.
instead of .
), it's ?
now
I kept the (com\.|co\.)?
for readability (instead of (com?\.)?
, should I use (com?\.)?
instead ?
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.
Imho it's good like this.
I'd maybe prefer having the dot on the other side like this: ...google(\\.com|\\.co)?\\.\\w+
For me it reads a bit better, but it's really just a cosmetics 🤷
491fa03
to
fbf2019
Compare
fbf2019
to
4160899
Compare
Hardcode a white list for all
google.*
domain namesNote: this is more generic than the real exhaustive list from https://www.google.com/supported_domains