mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
fix(core): normalize slashes for url/baseUrl instead of throwing (#8066)
This commit is contained in:
parent
73d0ede21a
commit
bcae7503ff
4 changed files with 73 additions and 16 deletions
|
@ -69,6 +69,9 @@ export const URISchema = Joi.alternatives(
|
|||
// This custom validation logic is required notably because Joi does not
|
||||
// accept paths like /a/b/c ...
|
||||
Joi.custom((val: unknown, helpers) => {
|
||||
if (typeof val !== 'string') {
|
||||
return helpers.error('any.invalid');
|
||||
}
|
||||
try {
|
||||
// eslint-disable-next-line no-new
|
||||
new URL(String(val));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue