-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header user-agent is truncated #464
Comments
Thanks for your bug report. Currently I'm not aware of any place where we modify this header inside the framework (it's taken from the $context.identity API Gateway object). |
Is it not in AwsHttpApiV2ProxyHttpServletRequest.headersMapToMultiValue ? |
Good catch, that looks suspicious. Would you be willing to submit a pull request along with a small unittest? |
Ok I'll do my best to do it this week. |
…ates the user-agent (aws#464)
Fix is part of release 1.8.2 |
Serverless Java Container version:
Java 11 (Corretto)
Implementations:
Jersey (+ Dagger)
Framework version:
2.35
Frontend service:
HTTP API
Deployment method:
Console
Scenario
We just need to get the client user agent but the value is truncated after the comma.
Expected behavior
servletRequest.getHeader("User-Agent") should return:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
Actual behavior
servletRequest.getHeader("User-Agent") returns:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML
Steps to reproduce
`
package com.services.test;
import com.amazonaws.serverless.proxy.model.AwsProxyResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Enumeration;
@singleton
@path("test")
public class TestService {
}
`
Full log output
The text was updated successfully, but these errors were encountered: