Skip to content

Removed re-encoding of multipart content-disposition header values #336

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

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ If you have a question, or hit a problem, feel free to ask on our [gitter channe

Or, if you encounter a bug, something is unclear in the code or documentation, don’t hesitate and open an issue on GitHub.

### Testing Scala.js

Scala.js tests require [chromedriver](https://chromedriver.chromium.org/). It is downloaded automatically
by the `test` task. Make sure to run it before running tests in any other way, e.g. using `testOnly`.

### Building & testing the scala-native version

By default, sttp-native will **not** be included in the aggregate build of the root project. To include it, define the `STTP_NATIVE` environmental variable before running sbt, e.g.:
Expand Down
6 changes: 2 additions & 4 deletions core/src/main/scala/sttp/model/Part.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ case class Part[+T](
// enumerate all variants so that overload resolution works correctly
override def header(h: String): Option[String] = super.header(h)

def contentDispositionHeaderValue: String = {
def encode(s: String): String = new String(s.getBytes("utf-8"), "iso-8859-1")
"form-data; " + dispositionParamsSeq.map { case (k, v) => s"""$k="${encode(v)}"""" }.mkString("; ")
}
def contentDispositionHeaderValue: String =
"form-data; " + dispositionParamsSeq.map { case (k, v) => s"""$k="$v"""" }.mkString("; ")

def dispositionParams: Map[String, String] = dispositionParamsSeq.toMap

Expand Down
Loading