MultipartBody incorrectly appends a new line to string values
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 74/100
Direção de pesquisa
Comece localizando MultipartBody e sua lógica de serialização multipart; em seguida, inspecione como os valores de partes do tipo string e os separadores de boundary são gravados. Adicione ou atualize um teste de serialização específico para um valor string sem quebra de linha no final; a saída deve posicionar corretamente o CRLF do boundary, sem adicionar uma quebra de linha extra ao valor.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
The following code:
import com.microsoft.kiota.MultipartBody;
MultipartBody body = new MultipartBody();
body.addOrReplacePart("fileCreatedAt", "text/plain", "2026-11-15T22:54:31.014Z");
Produces the following output, which has an incorrect extra \r\n after the value and before the separator:
--db526cd4e4a945aaa9f079d8c9497dbf
Content-Type: text/plain
Content-Disposition: form-data; name="fileCreatedAt"
2026-11-15T22:54:31.014Z
--db526cd4e4a945aaa9f079d8c9497dbf--
The correct serialisation should have the value on the line directly preceding the separator. I ran into issue with the current implementation with services (correctly) adding the new line to the end of the value, which then failed to match their validation regex.
The correct serialisation is:
--db526cd4e4a945aaa9f079d8c9497dbf
Content-Type: text/plain
Content-Disposition: form-data; name="fileCreatedAt"
2026-11-15T22:54:31.014Z
--db526cd4e4a945aaa9f079d8c9497dbf--
As per: https://www.rfc-editor.org/info/rfc2046/#section-5.1.1
NOTE: The CRLF preceding the boundary delimiter line is conceptually
attached to the boundary so that it is possible to have a part that
does not end with a CRLF (line break). Body parts that must be
considered to end with line breaks, therefore, must have two CRLFs
preceding the boundary delimiter line, the first of which is part of
the preceding body part, and the second of which is part of the
encapsulation boundary.
Happy to send you a PR to fix this if that would be useful.
- Linguagem predominante
- Java
- Estrelas
- 38
- Forks
- 37
- Merge médio
- 1d 2h
- PRs com merge (30d)
- 42
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/kiota-java
-
#1786 breaks compilation with Eclipse compilerTalvez já em andamento @Bhumit267 assumiu há 14 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 38/100
microsoft/kiota-java#2000 ·
Mantenedores costumam responder em até 1 dia
-
upgrade to okhttp 5Talvez já em andamento @ramsessanchez assumiu há 125 dias. Abertaenhancement help wanted
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
microsoft/kiota-java#1984 · 10 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
Very old stax implementation causes Error in relation with quarkus and HibernateTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. AbertaNeeds: Attention :wave: type:question
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
microsoft/kiota-java#1928 · 6 comentários ·
Mantenedores costumam responder em até 1 dia
-
http - implement body inspection handlerTalvez livre de novo @Nikk8091 assumiu há 77 dias e não há nenhum pull request aberto. Abertaenhancement help wanted type:enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
microsoft/kiota-java#1685 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
microsoft/kiota-java#1612 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de microsoft/kiota-java
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
btraceio/jafar#228 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
jenkinsci/git-client-plugin#1807 ·
-
area-templates triage:bot-seen triage:needs-human
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
microsoft/aspire#22356 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
apache/flink-agents#1395 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
floci-io/floci#8666 · 1 comentário ·
Mantenedores costumam responder em até 1 dia