scala-server-lambda
scala-server-lambda copied to clipboard
Loss of content type
First of all, nice work.
I spotted an issue with the loss of the Content Type within the AkkaHttpLambdaHandler.proxyToAkkaRequest method.
What happens.
- User makes a request with Content-Type set to 'application/json' (can be anything really).
- Code recreates the HttpRequest by using HttpEntity.apply on the body.
- The above step results in the below, which can show the loss of the content-type.
HttpEntity.Strict(text/plain; charset=UTF-8,{ "name": "ArmandoPadilla" })
From the Akka-http perspective. This causes issues when using entity[as[JsValue]] which results in.
The request's Content-Type is not supported. Expected: application/json
Interesting, thanks for reporting. At initial glance the code looks right:
https://github.com/howardjohn/scala-server-lambda/blob/master/akka-http-lambda/src/main/scala/io/github/howardjohn/lambda/akka/AkkaHttpLambdaHandler.scala#L45-L55
but maybe there is a subtle bug.
I'd be happy to merge any PRs but I probably won't be able to get to fixing this anytime soon due to lack of time