Fixed 403 Forbidden thrown when getting Website metadata
- Add User-Agent to header to prevent 403 Forbidden when downloading webpage strings - Add Bookmark URL and User Id unique combo constraint - Add Tag Name and User Id unique combo constraint
This commit is contained in:
@ -253,6 +253,7 @@ namespace YABA.Service
|
||||
private void UpdateBookmarkWithMetaData(IBookmark bookmark)
|
||||
{
|
||||
var webClient = new WebClient();
|
||||
webClient.Headers.Add("User-Agent", "APIClient");
|
||||
var sourceData = webClient.DownloadString(bookmark.Url);
|
||||
var title = Regex.Match(sourceData, @"\<title\b[^>]*\>\s*(?<Title>[\s\S]*?)\</title\>", RegexOptions.IgnoreCase).Groups["Title"].Value;
|
||||
var description = string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user