Description
To help us debug your issue fill in the basic information below using the options provided
Serverless Java Container version: eg. 1.5
2.0.0-M2
Implementations: Jersey / Spring / Spring Boot / Spring Boot 2 / Spark
Spring Boot 3
Framework version: eg SpringBoot 2.2.6.RELEASE
Spring Boot 3.1.3
Frontend service: REST API / HTTP API / ALB
ALB
Multiheaders enabled in the Target Group
Deployment method: eg SAM, Serverless Framework, Console
SAM
Scenario
Describe what you are trying to accomplish
Implement a Rest API with HATEOAS.
Expected behavior
Describe how you would expect the application to behave
The request
GET /people HTTP/1.1
Host: cirrus-recuperacao-lambda-public-2025369026.sa-east-1.elb.amazonaws.com
should return the result
{
"_embedded": {
"personList": [
{
"id": 1,
"name": "John",
"age": 30,
"_links": {
"self": {
"href": "http://cirrus-recuperacao-lambda-public-2025369026.sa-east-1.elb.amazonaws.com/person/1"
}
}
},
{
"id": 3,
"name": "Bob",
"age": 10,
"_links": {
"self": {
"href": "http://cirrus-recuperacao-lambda-public-2025369026.sa-east-1.elb.amazonaws.com/person/3"
}
}
}
]
}
}
Actual behavior
Describe what you are seeing instead
{
"_embedded": {
"personList": [
{
"id": 1,
"name": "John",
"age": 30,
"_links": {
"self": {
"href": "http://null.execute-api.sa-east-1.amazonaws.com/person/1"
}
}
},
{
"id": 3,
"name": "Bob",
"age": 10,
"_links": {
"self": {
"href": "http://null.execute-api.sa-east-1.amazonaws.com/person/3"
}
}
}
]
}
}
Steps to reproduce
Provide code samples we can use to reproduce the issue as part of our integration tests. If there is a public repository for the misbehaving application link to it here
Sample code: https://github.com/luizck/spring-hateoas-lambda
It seems the problem is located in the method SecurityUtils.isValidHost, since it compares the ALB's hostname with the API Gateway Id, which is not provided: