Skip to content

Relative url with required domain does not validate #4044

@matthieusieben

Description

@matthieusieben

Support plan

  • which support plan is this issue covered by? Community
  • is this issue currently blocking your project? yes
  • is this issue affecting a production system? no

Context

  • node version: v13.7.0
  • module version with issue: 17.1.0
  • last module version without issue: -
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): standalone
  • any other relevant information: -

What are you trying to achieve or the steps to reproduce?

const schema = Joi.string().max(256).uri({relativeOnly:true, domain: { minDomainSegments: 2 } })
Joi.attempt('//example.com/foo', schema) // throws

What was the result you got?

"value" must be a valid relative uri (string.uriRelativeOnly)

What result did you expect?

Relative urls (relative to the protocol) should validate

Metadata

Metadata

Assignees

Labels

supportQuestions, discussions, and general support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions