Skip to content

Commit

Permalink
fix: remove redundant and faulty condition in hapi path generation
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Oct 31, 2022
1 parent 21126b4 commit e756be6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/generateHapiPath.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default function generateHapiPath(path, options, serverless) {
// path must start with '/'
let hapiPath = path.startsWith('/') ? path : `/${path}`

if (!options.noPrependStageInUrl) {
Expand All @@ -12,7 +11,7 @@ export default function generateHapiPath(path, options, serverless) {
hapiPath = `/${options.prefix}${hapiPath}`
}

if (hapiPath !== '/' && hapiPath.endsWith('/') && hapiPath.endsWith('+}/')) {
if (hapiPath !== '/' && hapiPath.endsWith('/')) {
hapiPath = hapiPath.slice(0, -1)
}

Expand Down

0 comments on commit e756be6

Please sign in to comment.