Home / Function/ isHttpUrl() — astro Function Reference

isHttpUrl() — astro Function Reference

Architecture documentation for the isHttpUrl() function in util.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  f6bbb23c_1c60_095a_0b0e_96634b549f5f["isHttpUrl()"]
  05241a8b_1820_8286_5770_4da18477ecde["util.ts"]
  f6bbb23c_1c60_095a_0b0e_96634b549f5f -->|defined in| 05241a8b_1820_8286_5770_4da18477ecde
  f16d0d52_160f_152d_f7fe_a1fd178b948b["addAttribute()"]
  f16d0d52_160f_152d_f7fe_a1fd178b948b -->|calls| f6bbb23c_1c60_095a_0b0e_96634b549f5f
  style f6bbb23c_1c60_095a_0b0e_96634b549f5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/util.ts lines 310–317

function isHttpUrl(url: string) {
	try {
		const parsedUrl = new URL(url);
		return VALID_PROTOCOLS.includes(parsedUrl.protocol);
	} catch {
		return false;
	}
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does isHttpUrl() do?
isHttpUrl() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/util.ts.
Where is isHttpUrl() defined?
isHttpUrl() is defined in packages/astro/src/runtime/server/render/util.ts at line 310.
What calls isHttpUrl()?
isHttpUrl() is called by 1 function(s): addAttribute.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free