mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
perf(lambda-web): skip the host pattern on other services' requests (#7856)
This commit is contained in:
1 parent
faf9c4e64d
commit
fef0497cde
2 files changed
+3
-1
No files matched your search
@@ -510,7 +510,8 @@ public class LambdaWebDataPlane {
|
||||
|
||||
/** The shapes Floci mints, in any case and with any port, so a near miss gets the AWS 404 and not another service. */
|
||||
static boolean isLambdaWebHost(String host) {
|
||||
return ENDPOINT_DOMAIN.matcher(host).matches();
|
||||
// Every request of every service asks, so the dot after the id is checked before the pattern.
|
||||
return host.length() > 16 && host.charAt(16) == '.' && ENDPOINT_DOMAIN.matcher(host).matches();
|
||||
}
|
||||
|
||||
/** The app gets the path without dot segments, as on AWS. Repeated slashes and the query stay as sent. */
|
||||
|
||||
@@ -19,6 +19,7 @@ class LambdaWebDataPlaneTest {
|
||||
assertFalse(LambdaWebDataPlane.isLambdaWebHost("my.lambda-web.archive.localhost:4566"));
|
||||
assertFalse(LambdaWebDataPlane.isLambdaWebHost("abcdefghijklmnop.lambda-url.us-east-1.localhost:4566"));
|
||||
assertFalse(LambdaWebDataPlane.isLambdaWebHost("localhost:4566"));
|
||||
assertFalse(LambdaWebDataPlane.isLambdaWebHost("abcdefghijklmnop"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user