Skip to content
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

Use cliqz-url-parser for URL processing. #410

Merged
merged 4 commits into from Jul 17, 2019

Conversation

@sammacbeth
Copy link
Contributor

@sammacbeth sammacbeth commented Jul 4, 2019

Updates utils.processUrl to use the cliqz url-parser implementation instead of the current node url.parse. Our benchmarks show this should be able 10x faster than the node implementation.

@sammacbeth sammacbeth requested a review from ghostery/ghostery as a code owner Jul 4, 2019
@remusao
remusao approved these changes Jul 4, 2019
@christophertino christophertino changed the base branch from master to develop Jul 4, 2019
@sammacbeth sammacbeth force-pushed the sammacbeth:cliqz-url-parser branch from 9b89b39 to 6044117 Jul 5, 2019
protocol: res.protocol ? res.protocol.substr(0, res.protocol.length - 1) : '',
host: res.hostname || '',
path: res.pathname ? res.pathname.substr(1) : '',
host_with_path: (res.host || '') + (res.pathname || ''),

This comment has been minimized.

@sammacbeth

sammacbeth Jul 5, 2019
Author Contributor

This was carried over as-is from the previous version, but I wonder if it intentional that you use host here instead of hostname. The former includes the port number if it is non-standard. Are there patterns that use this information? If not, we could use hostname here to be more consistent. @christophertino

This comment has been minimized.

@jsignanini

jsignanini Jul 11, 2019
Member

I think that since we were creating a somewhat custom object being returned from processUrl(), and not aiming to exactly replicate the URL() function, we just named it host for convenience but I agree that it could lead to confusion.

@sammacbeth sammacbeth requested review from jsignanini and zarembsky as code owners Jul 5, 2019
@christophertino christophertino added this to the 8.4.1 milestone Jul 11, 2019
@christophertino christophertino merged commit 70a5a72 into ghostery:develop Jul 17, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants