feat(client-redirects-plugin): support fully qualified urls and querystring/hash in destination/to url (#9171)

This commit is contained in:
Sébastien Lorber 2023-07-21 19:54:40 +02:00 committed by GitHub
parent 4ea0a70f93
commit 09ea3bcfab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 260 additions and 44 deletions

View file

@ -30,9 +30,9 @@ exports[`validation schemas contentVisibilitySchema: for value={"unlisted":"bad
exports[`validation schemas contentVisibilitySchema: for value={"unlisted":42} 1`] = `""unlisted" must be a boolean"`;
exports[`validation schemas pathnameSchema: for value="foo" 1`] = `""value" is not a valid pathname. Pathname should start with slash and not contain any domain or query string."`;
exports[`validation schemas pathnameSchema: for value="foo" 1`] = `""value" (foo) is not a valid pathname. Pathname should start with slash and not contain any domain or query string."`;
exports[`validation schemas pathnameSchema: for value="https://github.com/foo" 1`] = `""value" is not a valid pathname. Pathname should start with slash and not contain any domain or query string."`;
exports[`validation schemas pathnameSchema: for value="https://github.com/foo" 1`] = `""value" (https://github.com/foo) is not a valid pathname. Pathname should start with slash and not contain any domain or query string."`;
exports[`validation schemas pluginIdSchema: for value="/docs" 1`] = `"Illegal plugin ID value "/docs": it should only contain alphanumerics, underscores, and dashes."`;

View file

@ -91,7 +91,7 @@ export const PathnameSchema = Joi.string()
return val;
})
.message(
'{{#label}} is not a valid pathname. Pathname should start with slash and not contain any domain or query string.',
'{{#label}} ({{#value}}) is not a valid pathname. Pathname should start with slash and not contain any domain or query string.',
);
// Normalized schema for url path segments: baseUrl + routeBasePath...