Skip to content

Commit

Permalink
re add accidentally dropped leading / in versioned docs regex pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
nain-F49FF806 authored Oct 10, 2024
1 parent 4ceb656 commit 06ea286
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ exports.handler = (event, context, callback) => {
}

// Forward patch versioned documentation as-is.
if (/^(\d+)\.(\d+).(\d+)\/(.*)/.test(request.uri)) {
if (/^\/(\d+)\.(\d+).(\d+)\/(.*)/.test(request.uri)) {
return callback(null, request);
}
// Include patch version 0 if minor versioned documentation is requested
const minor_versioned_pattern = /^\/?(\d+)\.(\d+)\/(.*)/
const minor_versioned_pattern = /^\/(\d+)\.(\d+)\/(.*)/
if (minor_versioned_pattern.test(request.uri)) {
const patched_uri = request.uri.replace(minor_versioned_pattern, "/$1.$2.0/$3");
return temp_redirect(patched_uri, callback);
Expand Down

0 comments on commit 06ea286

Please sign in to comment.