Comments (3)
Exposing parseUrl (or a wrapper around it) sounds reasonable. It's a bit of duplicate work for you, parsing then doing a lookup. It's also heavier than the regex solution from the xurls package.
Another solution (which was talked about in another issue) was creating exposed errors/error types that clients could match on easier. In this case, maybe it would return a ParseError which you could check via a type assertion. The problem with that for LookupURLs is that it takes a slice of URLs, but can return a single error. So you'd have to un-batch to get these benefits.
What do you think?
from safebrowsing.
I'd prefer the first solution, because we're parsing the URLs anyway to extract various components, so the rework isn't too much of an issue, whereas the latter would be a bit messy codewise, and we'd have to some rather strange error cases to handle such as what to do if one link in a message containing 3 links is not properly formatted.
from safebrowsing.
Sorry for the delayed response! I've created a pull request that exposes a "IsURL" function. It doesn't necessarily eliminate the need to do some basic string splitting/regex work to find URLs (as explained in the commit), but would prevent getting a parse error when calling LookupURLs.
from safebrowsing.
Related Issues (20)
- How to query a historical snapshot? HOT 1
- Can you plz clarify the URL format that needs to be sent in the query? HOT 2
- Will this library be compatible with the new Web Risks API? HOT 1
- Why is the API marking Chinese cdns as unsafe while online/browser lookup aren't ? HOT 1
- project question / adding third-party threats
- Cripto
- Inconsistent Database: Threat List Mismatches HOT 7
- SafeSites URL filter - query filter?
- [email protected] HOT 1
- bnb1p5tus3kyl8euzu385pwzcj00wu7rjkpq4x5mqr
- Get the 'database is now healthy' every time.
- Please export the `safebrowing_proto` package
- I wonder what technique google safe browsing uses to update the API's list of malicious urls so that the API can detect the latest malicious urls, such as machine learning techniques? And how often is the API blacklist of malicious urls updated?
- digitalPhone issues
- Why does safe browsing remove some URLs? Then some of them re-added later on
- Is there an API to bulk report malicious websites to SafeBrowsing ?!
- New run
- Unsafe URL to test the Web Risk API HOT 1
- How are Multiple Encoded URIs Handled? HOT 1
- Review requests for GitHub repositories
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safebrowsing.