-
Notifications
You must be signed in to change notification settings - Fork 448
Fix #1042: Implement DomainAndRegistry for eTLD+1 #5239
Conversation
8861635
to
60b798a
Compare
Is there any way we can expose a way to extract an etld from a host string and not a url? I suppose I can cheat a bit and create a url with a fixed scheme if not. |
Merging this one after security review passes, any subsequent improvements to the url helper methods will be handled as new tickets cc @cuba |
81563f6
to
eb6d2f4
Compare
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.
Left some comments that are minor but other than that I'll let you judge the best direction.
XCTAssertEqual("d.kawasaki.jp", expected) | ||
XCTAssertEqual("d.kawasaki.jp", url.host?.publicSuffix) | ||
} | ||
|
||
func testExceptionDomain() { | ||
// TLD Entry: !city.kawasaki.jp | ||
let url = "http://city.kawasaki.jp".asURL! | ||
let expected = url.publicSuffix! |
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.
Maybe remove that !
You're testing it's not nil so I don't think you should put that ! there plus you don't really need it. Both would result in a failed test but one will give you some better test information.
@@ -144,41 +179,47 @@ class NSURLExtensionsTests: XCTestCase { | |||
let url = "http://bbc.co.uk".asURL! | |||
let expected = url.baseDomain! |
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.
Same as above and all the rest below.
eb6d2f4
to
6d3377f
Compare
6d3377f
to
b50ef96
Compare
b50ef96
to
4efd31a
Compare
Security Review
Summary of Changes
domainAndRegistry
anddomainAndRegistryExcludingPrivateRegistries
.registry
(public suffix)This pull request fixes #1042
Submitter Checklist:
NSLocalizableString()
Test Plan:
public_suffix_list
: https://publicsuffix.org/list/public_suffix_list.datprint
popup abuse the user: https://brandon-t.github.io/WindowPrint.html)
- Test Sharing a URL (youtube, twitter, bbc.co.uk, etc) - Test History and recent searches showing properly (also test recent searches not different from previous build when upgrading) - Test BraveNews still worksReviewer Checklist:
QA/(Yes|No)
bug
/enhancement