mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(lambda): resolve handler paths with a leading "./" against the package (#1575)
A Node/file-based handler can be given with a leading "./" — e.g. "./v1/lambda-handlers/entry.handler", as the terraform-aws-modules/lambda module (and DPS) emit. resolveHandlerFilePath stripped only the ".handler" export suffix, leaving "./v1/lambda-handlers/entry", which never matched the deployment-package entry "v1/lambda-handlers/entry.js" (stored without the "./"). CreateFunction then rejected the function with "Handler file '...' not found in deployment package". Normalize a leading "./" away before matching the handler against the package.
This commit is contained in:
1 parent
ad1cc22c19
commit
0a806f7382
2 files changed
+43
No files matched your search
@@ -1201,6 +1201,12 @@ public class LambdaService {
|
||||
if (fn.getRuntime().startsWith("python")) {
|
||||
return modulePath.replace('.', '/');
|
||||
}
|
||||
// A file-based handler may be given with a leading "./" (e.g.
|
||||
// "./v1/lambda-handlers/entry.handler"); deployment-package entries are stored without
|
||||
// it, so normalize the prefix away before matching.
|
||||
if (modulePath.startsWith("./")) {
|
||||
modulePath = modulePath.substring(2);
|
||||
}
|
||||
return modulePath;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user