Skip to content

base64 validation #1081

@b2mdevelopment

Description

@b2mdevelopment

Context

  • node version: 4.5.0
  • joi version:10.1.0
  • environment (node, browser): node
  • used with (hapi, standalone, ...): standalone
  • any other relevant information:

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

validate base64 string
Describe your issue here, include schemas and inputs you are validating if needed.

const schema = { key: Joi.string().base64() }

input = {key:'eyJ3b3JsZGlkRGF5IjoiV09STERJRDpEQVkifQ'}

Which result you had ?

{ failed: true,
error:
{ [ValidationError: child "lastKey" fails because ["lastKey" must be a valid base64 string]]
isJoi: true,
name: 'ValidationError',
details: [ [Object] ],
_object:
{
lastKey: 'eyJ3b3JsZGlkRGF5IjoiV09STERJRDpEQVkifQ' },
annotate: [Function] },
validationError: true }

What did you expect ?

no joi validation errors as input is valid base64

Metadata

Metadata

Assignees

Labels

non issueIssue is not a problem or requires changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions