Skip to content

Commit fb42f05

Browse files
bensabicCopilot
andauthored
chore: update plugins/brandfetch/steps/get-brand.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f4fda82 commit fb42f05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugins/brandfetch/steps/get-brand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ async function stepHandler(
113113
const identifierType = input.identifierType || "domain";
114114

115115
if (identifierType === "domain") {
116-
if (!identifier.includes(".")) {
116+
// Validate domain format: must have at least one character before and after the dot, no spaces, no leading/trailing dot
117+
if (
118+
!/^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]?(\.[a-zA-Z]{2,})+$/.test(identifier)
119+
) {
117120
return {
118121
success: false,
119122
error: "Invalid domain format. Expected format: example.com",

0 commit comments

Comments
 (0)