Allow HttpRequest entity content-type without parameters.
- Dominant language
- Scala
- Stars
- 1.4k
- Forks
- 584
- Avg merge
- 14h 33m
- Merged PRs (30d)
- 24
Description
According to the HTTP specification section [3.7](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7), older HTTP clients/server may not be able to handle Media Type definition with parameters.
While implementing the test suite for [AWS Signature 4](https://github.com/akka/alpakka/pull/120), I did not found a way to build a HttpRequest, with body's content-type (media type) without parameters.
It is this possible with current implementation?
So, if I build a HttpRequest as:
`
HttpRequest(HttpMethods.getForKey(rawMethod.trim).getOrElse(HttpMethods.CONNECT), encodeIfRequired(rawUri),
headers, HttpEntity(body), HttpProtocols.getForKey(rawProtocol).getOrElse(HttpProtocols.HTTP/1.1))
`
And `headers` variable already contains a Content-Type header, then I'm expecting that this header will not be overwritten by HttpRequest implementation when the HttpEntity is created.
Contributor guide
Research direction
Start by reading the HttpRequest construction path and HttpEntity content-type handling described in the issue. Trace how an existing Content-Type header is treated when the entity is created, then verify that a request can retain a media type without parameters and that the current behavior remains covered by regression testing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100