{"record":{"id":"cb6d5366789a5706","repo":"multica-ai/multica","slug":"value-must-be-an-http-s-url","errorCode":null,"errorMessage":"value must be an http(s) URL","messagePattern":"value must be an http\\(s\\) URL","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/internal/handler/property.go","lineNumber":340,"sourceCode":"\t\tif strings.TrimSpace(s) == \"\" {\n\t\t\treturn nil, errors.New(\"value cannot be empty (use DELETE to unset a property)\")\n\t\t}\n\t\tif utf8.RuneCountInString(s) > maxPropertyTextValueLen {\n\t\t\treturn nil, fmt.Errorf(\"value must be %d characters or fewer\", maxPropertyTextValueLen)\n\t\t}\n\t\treturn json.Marshal(sanitizeNullBytes(s))\n\tcase \"url\":\n\t\ts, ok := v.(string)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"value must be a URL string\")\n\t\t}\n\t\ts = strings.TrimSpace(s)\n\t\tif len(s) > maxPropertyURLValueLen {\n\t\t\treturn nil, fmt.Errorf(\"value must be %d characters or fewer\", maxPropertyURLValueLen)\n\t\t}\n\t\tu, err := url.Parse(s)\n\t\tif err != nil || (u.Scheme != \"http\" && u.Scheme != \"https\") || u.Host == \"\" {\n\t\t\treturn nil, errors.New(\"value must be an http(s) URL\")\n\t\t}\n\t\treturn json.Marshal(s)\n\tcase \"number\":\n\t\tif _, ok := v.(float64); !ok {\n\t\t\treturn nil, errors.New(\"value must be a number\")\n\t\t}\n\t\treturn json.Marshal(v)\n\tcase \"checkbox\":\n\t\tif _, ok := v.(bool); !ok {\n\t\t\treturn nil, errors.New(\"value must be true or false\")\n\t\t}\n\t\treturn json.Marshal(v)\n\tcase \"date\":\n\t\ts, ok := v.(string)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"value must be a date string in YYYY-MM-DD format\")\n\t\t}\n\t\tif _, err := time.Parse(\"2006-01-02\", s); err != nil {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/handler/property.go#L322-L358","documentation":"validatePropertyValue enforces that URL-type property values parse as absolute http or https URLs with a host. Values that fail url.Parse, use another scheme (ftp:, mailto:, file:), or lack a host (\"example.com\", \"/relative\") are rejected with this message so the stored URL is always clickable and safe to render.","triggerScenarios":"PUT/PATCH a url property with \"ftp://host/x\", \"mailto:a@b.c\", \"example.com/path\" (no scheme), \"https://\" (no host), or a malformed string that fails url.Parse. Also triggered by URLs with whitespace inside since only leading/trailing spaces are trimmed.","commonSituations":"Users pasting bare domains without https://; forms intended for internal links storing relative paths; mailto links stored in a url field because the definition type was chosen incorrectly.","solutions":["Prefix the scheme: normalize input to https:// when missing","Use an absolute http(s) URL including host: \"https://example.com/path\"","If you need relative links, mailto, or custom schemes, switch the property definition to type \"text\" instead of \"url\""],"exampleFix":"// before\n{ value: \"example.com/docs\" }\n// after\n{ value: \"https://example.com/docs\" }","handlingStrategy":"validation","validationCode":"function toHttpUrl(input: string): string | null {\n  const s = input.trim();\n  const withScheme = /^https?:\\/\\//i.test(s) ? s : `https://${s}`;\n  try {\n    const u = new URL(withScheme);\n    return u.host ? u.href : null;\n  } catch { return null; }\n}\nconst normalized = toHttpUrl(value);\nif (!normalized) showFieldError('Enter an absolute http(s) URL');","typeGuard":"function isHttpUrl(s: string): boolean {\n  try { const u = new URL(s); return (u.protocol === 'http:' || u.protocol === 'https:') && u.host !== ''; }\n  catch { return false; }\n}","tryCatchPattern":null,"preventionTips":["Auto-prepend https:// when the user omits the scheme","Block relative paths and non-http schemes in the url input","Remember the backend also caps URL length at 2048 bytes"],"tags":["validation","url","issue-properties"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}