@scalar/fastify-api-reference 1.25.33 → 1.25.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/fastifyApiReference.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +6 -1
- package/dist/js/standalone.js +10890 -10833
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14462,7 +14462,8 @@ const fastifyApiReference = fp(
|
|
|
14462
14462
|
return reply.header("Content-Type", `application/yaml`).header("Content-Disposition", `filename=${filename}.yaml`).send(yaml);
|
|
14463
14463
|
}
|
|
14464
14464
|
});
|
|
14465
|
-
|
|
14465
|
+
const doesNotIgnoreTrailingSlash = fastify.initialConfig.ignoreTrailingSlash !== true;
|
|
14466
|
+
if (doesNotIgnoreTrailingSlash && getRoutePrefix(options.routePrefix)) {
|
|
14466
14467
|
fastify.route({
|
|
14467
14468
|
method: "GET",
|
|
14468
14469
|
url: getRoutePrefix(options.routePrefix),
|
|
@@ -14482,6 +14483,10 @@ const fastifyApiReference = fp(
|
|
|
14482
14483
|
schema: schemaToHideRoute,
|
|
14483
14484
|
...hooks,
|
|
14484
14485
|
handler(_, reply) {
|
|
14486
|
+
const currentUrl = new URL(_.url, `${_.protocol}://${_.hostname}`);
|
|
14487
|
+
if (!currentUrl.pathname.endsWith("/")) {
|
|
14488
|
+
return reply.redirect(`${currentUrl.pathname}/`, 301);
|
|
14489
|
+
}
|
|
14485
14490
|
if (specSource.type !== "url") {
|
|
14486
14491
|
configuration = {
|
|
14487
14492
|
...configuration,
|