Open prateekr opened 5 years ago
Thanks, @prateekr (and sorry for not answering sooner). I agree, adding content-disposition
to the alwaysParsedHeaders
seems like an easy way to get this fixed. Can you open a PR?
Sure, I'll take a look.
Please note, we need to disable config modeled-header-parsing
to let the AKKA use the correct format of the Content-Disposition
header. Otherwise, the AKKA will fail to pass examples below:
# All ascii
Content-Disposition: attachment; filename="download.csv"; filename*=UTF-8''another-ascii-name.csv
# UTF-8 name
Content-Disposition: attachment; filename="download.csv"; filename*=UTF-8''%E4%B8%8B%E8%BD%BD.csv
Replicated error on: HEAD of master (25f5eb128e62f303f84f9bcdafd2a7861d604458 currently) My version: v10.0.14
The above test with
akka.http.parsing.modeled-header-parsing
disabled will fail with the following:Note: Just disabling
akka.http.server.parsing.modeled-header-parsing
(i.e. disabling only for the server) will result in a success.It looks like there is some parser engine that MultiPart marshaller uses (i.e. not the server parser engine) that initializes the HttpHeaderParser with header-parsing off https://github.com/akka/akka-http/blob/25f5eb128e62f303f84f9bcdafd2a7861d604458/akka-http-core/src/main/scala/akka/http/impl/engine/parsing/HttpHeaderParser.scala#L472-L475 (i.e. respecting the
akka.http.parsing.modeled-header-parsing
flag) causing this to fail.Adding
Content-Disposition
tohttps://github.com/akka/akka-http/blob/25f5eb128e62f303f84f9bcdafd2a7861d604458/akka-http-core/src/main/scala/akka/http/impl/engine/parsing/HttpHeaderParser.scala#L446-L458
fixes this, but I don't have the necessary context to know why it was left off
alwaysParsedHeaders
list in the first place.