Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
fix(.net-sdk): address round 2 cubic review feedback
Devin AIf29fcdab1570
diff --git a/apps/.net-sdk/Firecrawl/FirecrawlHttpClient.cs b/apps/.net-sdk/Firecrawl/FirecrawlHttpClient.csindex 5fe0b694e..e04b68d47 100644--- a/apps/.net-sdk/Firecrawl/FirecrawlHttpClient.cs+++ b/apps/.net-sdk/Firecrawl/FirecrawlHttpClient.cs@@ -89,11 +89,13 @@ internal class FirecrawlHttpClient// Validate that the pagination URL belongs to the same host to prevent API key exfiltrationvar targetUri = new Uri(absoluteUrl);var baseUri = new Uri(_baseUrl);- if (!string.Equals(targetUri.Host, baseUri.Host, StringComparison.OrdinalIgnoreCase))+ if (!string.Equals(targetUri.Scheme, baseUri.Scheme, StringComparison.OrdinalIgnoreCase) ||+ !string.Equals(targetUri.Host, baseUri.Host, StringComparison.OrdinalIgnoreCase) ||+ targetUri.Port != baseUri.Port){throw new FirecrawlException(- $"Pagination URL host '{targetUri.Host}' does not match API base URL host '{baseUri.Host}'. " +- "Refusing to send credentials to a different host.");+ $"Pagination URL origin '{targetUri.Scheme}://{targetUri.Host}:{targetUri.Port}' does not match API base URL origin '{baseUri.Scheme}://{baseUri.Host}:{baseUri.Port}'. " ++ "Refusing to send credentials to a different origin.");}var request = new HttpRequestMessage(HttpMethod.Get, absoluteUrl);diff --git a/apps/.net-sdk/Firecrawl/Models/SearchData.cs b/apps/.net-sdk/Firecrawl/Models/SearchData.csindex 70fa4cb8e..7c44b2a38 100644--- a/apps/.net-sdk/Firecrawl/Models/SearchData.cs+++ b/apps/.net-sdk/Firecrawl/Models/SearchData.cs@@ -3,9 +3,9 @@ using System.Text.Json.Serialization;namespace Firecrawl.Models;/// <summary>-/// Represents a single search hit with URL, title, and snippet.+/// Represents a single web search hit./// </summary>-public class SearchHit+public class WebSearchHit{[JsonPropertyName("url")]public string? Url { get; set; }@@ -16,6 +16,12 @@ public class SearchHit[JsonPropertyName("description")]public string? Description { get; set; }+ [JsonPropertyName("position")]+ public int? Position { get; set; }++ [JsonPropertyName("category")]+ public string? Category { get; set; }+[JsonPropertyName("markdown")]public string? Markdown { get; set; }@@ -25,14 +31,92 @@ public class SearchHit[JsonPropertyName("rawHtml")]public string? RawHtml { get; set; }+ [JsonPropertyName("links")]+ public List<string>? Links { get; set; }++ [JsonPropertyName("screenshot")]+ public string? Screenshot { get; set; }+[JsonPropertyName("metadata")]public Dictionary<string, object>? Metadata { get; set; }+ [JsonPropertyName("answer")]+ public string? Answer { get; set; }+}++/// <summary>+/// Represents a news search result with news-specific fields.+/// </summary>+public class NewsSearchHit+{+ [JsonPropertyName("url")]+ public string? Url { get; set; }++ [JsonPropertyName("title")]+ public string? Title { get; set; }++ [JsonPropertyName("snippet")]+ public string? Snippet { get; set; }++ [JsonPropertyName("date")]+ public string? Date { get; set; }++ [JsonPropertyName("imageUrl")]+ public string? ImageUrl { get; set; }++ [JsonPropertyName("position")]+ public int? Position { get; set; }++ [JsonPropertyName("category")]+ public string? Category { get; set; }++ [JsonPropertyName("markdown")]+ public string? Markdown { get; set; }++ [JsonPropertyName("html")]+ public string? Html { get; set; }++ [JsonPropertyName("rawHtml")]+ public string? RawHtml { get; set; }+[JsonPropertyName("links")]public List<string>? Links { get; set; }[JsonPropertyName("screenshot")]public string? Screenshot { get; set; }++ [JsonPropertyName("metadata")]+ public Dictionary<string, object>? Metadata { get; set; }++ [JsonPropertyName("answer")]+ public string? Answer { get; set; }+}++/// <summary>+/// Represents an image search result.+/// </summary>+public class ImageSearchHit+{+ [JsonPropertyName("title")]+ public string? Title { get; set; }++ [JsonPropertyName("imageUrl")]+ public string? ImageUrl { get; set; }++ [JsonPropertyName("imageWidth")]+ public int? ImageWidth { get; set; }++ [JsonPropertyName("imageHeight")]+ public int? ImageHeight { get; set; }++ [JsonPropertyName("url")]+ public string? Url { get; set; }++ [JsonPropertyName("position")]+ public int? Position { get; set; }++ [JsonPropertyName("answer")]+ public string? Answer { get; set; }}/// <summary>@@ -41,11 +125,11 @@ public class SearchHitpublic class SearchData{[JsonPropertyName("web")]- public List<SearchHit>? Web { get; set; }+ public List<WebSearchHit>? Web { get; set; }[JsonPropertyName("news")]- public List<SearchHit>? News { get; set; }+ public List<NewsSearchHit>? News { get; set; }[JsonPropertyName("images")]- public List<string>? Images { get; set; }+ public List<ImageSearchHit>? Images { get; set; }}