Skip to content
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

Loss of content type #7

Open
armandopadilla opened this issue Sep 18, 2019 · 1 comment
Open

Loss of content type #7

armandopadilla opened this issue Sep 18, 2019 · 1 comment

Comments

@armandopadilla
Copy link

First of all, nice work.

I spotted an issue with the loss of the Content Type within the AkkaHttpLambdaHandler.proxyToAkkaRequest method.

What happens.

  1. User makes a request with Content-Type set to 'application/json' (can be anything really).
  2. Code recreates the HttpRequest by using HttpEntity.apply on the body.
  3. 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

@howardjohn
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants