Implement a URL unfurl endpoint to the Sourcegraph API
Created by: jeanduplessis
Requirements
Add an endpoint to the Sourcegraph API that takes a URL as an input and returns meta-information regarding the URL.
Implementation details
When the endpoint received the request it will:
- Validate the input as a valid URL
- Check if a result exists in the cache for the URL
- If one exists and it is not stale (older than X hrs [TBD]) then return the result from the cache
- If no result exists or it is stale make a new request to the URL
- Make a request to the URL and parse the HTML for relevant meta tags
- Store the result in the cache
- Return the result
The following additional requirements should be considered:
- Follow redirects when making a request to the URL
Additional resources
Examples of URL unfurling services written in Go:
Relates to https://github.com/sourcegraph/sourcegraph/issues/15584